pub struct IndexSet { /* private fields */ }Implementations§
Source§impl IndexSet
impl IndexSet
pub fn new( build_params: impl Fn() -> Result<HnswParams, CoreError>, ) -> Result<Self, CoreError>
pub fn insert( &mut self, id: u64, memory_id: &str, embedding: &ThreeFieldEmbedding, rng_value: f64, ) -> Result<(), HnswError>
pub fn resolve_node_id(&self, node_id: u64) -> Option<&str>
pub fn rebuild_id_map(&mut self, entries: impl Iterator<Item = (u64, String)>)
pub fn search( &self, query: &[f32], top_k: usize, ) -> Result<Vec<(u64, f32)>, HnswError>
pub fn delete(&mut self, id: u64) -> Result<(), HnswError>
pub fn contains(&self, id: u64) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn serialize<W: Write>(&self, writer: &mut W) -> Result<()>
pub fn deserialize<R: Read>(reader: &mut R) -> Result<Self, HnswError>
Auto Trait Implementations§
impl Freeze for IndexSet
impl RefUnwindSafe for IndexSet
impl Send for IndexSet
impl Sync for IndexSet
impl Unpin for IndexSet
impl UnsafeUnpin for IndexSet
impl UnwindSafe for IndexSet
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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