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: usize, rng: &mut impl Rng)
fn insert_with_rng(&mut self, vector: Vector<N>, id: usize, rng: &mut impl Rng)
Insert a vector into the index with a custom rng.
Source§fn delete_by_id(&mut self, id: usize)
fn delete_by_id(&mut self, id: usize)
Delete a vector from the index by id.
Source§impl<'de, const N: usize> Deserialize<'de> for VectorLite<N>
impl<'de, const N: usize> Deserialize<'de> for VectorLite<N>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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