pub struct VectorLite<const N: usize> { /* private fields */ }Expand description
A lightweight lsh-based ann index.
Implementations§
Source§impl<const N: usize> VectorLite<N>
impl<const N: usize> VectorLite<N>
Sourcepub fn new(num_trees: usize, max_leaf_size: usize) -> Self
pub fn new(num_trees: usize, max_leaf_size: usize) -> Self
Create a new VectorLite index with the given number of trees and max leaf size. More trees means more accuracy but slower search and larger memory usage. Lower max_leaf_size means higher accuracy but larger memory usage.
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(bytes: &[u8]) -> Self
Trait Implementations§
Source§impl<const N: usize> ANNIndexOwned<N> for VectorLite<N>
impl<const N: usize> ANNIndexOwned<N> for VectorLite<N>
Source§fn insert_with_rng(&mut self, vector: Vector<N>, id: String, rng: &mut impl Rng)
fn insert_with_rng(&mut self, vector: Vector<N>, id: String, rng: &mut impl Rng)
Insert a vector into the index with a custom rng.
Source§fn delete_by_id(&mut self, id: String)
fn delete_by_id(&mut self, id: String)
Delete a vector from the index by id.
Source§impl<'__de, const N: usize> BorrowDecode<'__de> for VectorLite<N>
impl<'__de, const N: usize> BorrowDecode<'__de> for VectorLite<N>
Source§fn borrow_decode<__D: BorrowDecoder<'__de>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl<const N: usize> Decode for VectorLite<N>
impl<const N: usize> Decode for VectorLite<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for VectorLite<N>
impl<const N: usize> RefUnwindSafe for VectorLite<N>
impl<const N: usize> Send for VectorLite<N>
impl<const N: usize> Sync for VectorLite<N>
impl<const N: usize> Unpin for VectorLite<N>
impl<const N: usize> UnwindSafe for VectorLite<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