pub struct HotPathVectorStore { /* private fields */ }Expand description
Combined embedding and neighbor storage optimized for HNSW traversal
Implementations§
Source§impl HotPathVectorStore
impl HotPathVectorStore
Sourcepub fn new(
capacity: usize,
dim: usize,
num_layers: usize,
max_edges: usize,
) -> Option<Self>
pub fn new( capacity: usize, dim: usize, num_layers: usize, max_edges: usize, ) -> Option<Self>
Create new store
Sourcepub fn get_embedding(&self, id: usize) -> Option<&[f32]>
pub fn get_embedding(&self, id: usize) -> Option<&[f32]>
Get embedding
Sourcepub fn set_embedding(&mut self, id: usize, vector: &[f32]) -> bool
pub fn set_embedding(&mut self, id: usize, vector: &[f32]) -> bool
Set embedding
Sourcepub fn add_neighbor(&self, id: usize, layer: usize, neighbor: u32) -> bool
pub fn add_neighbor(&self, id: usize, layer: usize, neighbor: u32) -> bool
Add neighbor at layer
Sourcepub fn prefetch_node(&self, id: usize, layer: usize)
pub fn prefetch_node(&self, id: usize, layer: usize)
Prefetch for traversal (embedding + neighbors)
Sourcepub fn entry_point(&self) -> u32
pub fn entry_point(&self) -> u32
Get entry point
Sourcepub fn set_entry_point(&self, id: u32)
pub fn set_entry_point(&self, id: u32)
Set entry point
Sourcepub fn num_layers(&self) -> usize
pub fn num_layers(&self) -> usize
Get number of layers
Auto Trait Implementations§
impl !Freeze for HotPathVectorStore
impl RefUnwindSafe for HotPathVectorStore
impl Send for HotPathVectorStore
impl Sync for HotPathVectorStore
impl Unpin for HotPathVectorStore
impl UnsafeUnpin for HotPathVectorStore
impl UnwindSafe for HotPathVectorStore
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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