pub struct HnswBackend { /* private fields */ }Expand description
The in-memory HNSW backend persisted to a single fjall map.
Implementations§
Source§impl HnswBackend
impl HnswBackend
Sourcepub fn open(
base: &str,
config: &NitriteConfig,
params: &VectorIndexConfig,
) -> NitriteResult<(Self, bool)>
pub fn open( base: &str, config: &NitriteConfig, params: &VectorIndexConfig, ) -> NitriteResult<(Self, bool)>
Opens (loading from the store) or creates the HNSW backend. The second
return value is true when existing index data was unreadable and the
(now wiped) index must be rebuilt from the collection.
Sourcepub fn insert(&self, id: u64, vector: Vec<f32>) -> NitriteResult<()>
pub fn insert(&self, id: u64, vector: Vec<f32>) -> NitriteResult<()>
Inserts or replaces the vector for id, persisting the change.
Sourcepub fn remove(&self, id: u64) -> NitriteResult<()>
pub fn remove(&self, id: u64) -> NitriteResult<()>
Removes the vector for id, persisting the change.
Trait Implementations§
Source§impl Clone for HnswBackend
impl Clone for HnswBackend
Source§fn clone(&self) -> HnswBackend
fn clone(&self) -> HnswBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HnswBackend
impl !UnwindSafe for HnswBackend
impl Freeze for HnswBackend
impl Send for HnswBackend
impl Sync for HnswBackend
impl Unpin for HnswBackend
impl UnsafeUnpin for HnswBackend
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more