(&self, vid: &VectorId)
| 174 | /// lookup by vector_id |
| 175 | #[inline] |
| 176 | pub fn lookup(&self, vid: &VectorId) -> Option<(VectorId, Vector)> { |
| 177 | match self.vcache.get(vid) { |
| 178 | Some(v) => { |
| 179 | return Some((v.key().clone(), Vector(v.0.clone()))) |
| 180 | } |
| 181 | None => return None, |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | /// Finds the k-nearest neighbors to a given query vector in the storage. |
| 186 | /// |