pub struct VectorLiteIndex<const N: usize> { /* private fields */ }
Implementations§
Source§impl<const N: usize> VectorLiteIndex<N>
impl<const N: usize> VectorLiteIndex<N>
Sourcepub fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<&String>
pub fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<&String>
Search for the top_k nearest neighbors of the query vector. Returns a vector of ids, user may use the ids to compute the distance themselves. This is helpful when the vector is stored in a different place.
Sourcepub fn from_bytes(bytes: &[u8]) -> Self
pub fn from_bytes(bytes: &[u8]) -> Self
Deserialize the index from a byte vector.
Trait Implementations§
Source§impl<'__de, const N: usize, __Context> BorrowDecode<'__de, __Context> for VectorLiteIndex<N>
impl<'__de, const N: usize, __Context> BorrowDecode<'__de, __Context> for VectorLiteIndex<N>
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<const N: usize, __Context> Decode<__Context> for VectorLiteIndex<N>
impl<const N: usize, __Context> Decode<__Context> for VectorLiteIndex<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for VectorLiteIndex<N>
impl<const N: usize> RefUnwindSafe for VectorLiteIndex<N>
impl<const N: usize> !Send for VectorLiteIndex<N>
impl<const N: usize> !Sync for VectorLiteIndex<N>
impl<const N: usize> Unpin for VectorLiteIndex<N>
impl<const N: usize> UnwindSafe for VectorLiteIndex<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more