pub struct NeighborStorage { /* private fields */ }Expand description
Contiguous neighbor list storage for graph traversal
Implementations§
Source§impl NeighborStorage
impl NeighborStorage
Sourcepub fn get_neighbors(&self, node: usize) -> Option<&[u32]>
pub fn get_neighbors(&self, node: usize) -> Option<&[u32]>
Get neighbor list for node
Sourcepub fn add_neighbor(&self, node: usize, neighbor: u32) -> bool
pub fn add_neighbor(&self, node: usize, neighbor: u32) -> bool
Add neighbor to node (thread-safe)
Sourcepub fn set_neighbors(&mut self, node: usize, neighbors: &[u32]) -> bool
pub fn set_neighbors(&mut self, node: usize, neighbors: &[u32]) -> bool
Set all neighbors for a node (replaces existing)
Sourcepub fn prefetch_neighbors(&self, embeddings: &EmbeddingStorage, node: usize)
pub fn prefetch_neighbors(&self, embeddings: &EmbeddingStorage, node: usize)
Prefetch neighbors of neighbors (two-hop prefetch)
Sourcepub fn edge_count(&self, node: usize) -> usize
pub fn edge_count(&self, node: usize) -> usize
Get edge count for node
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get node count
Trait Implementations§
Source§impl Drop for NeighborStorage
impl Drop for NeighborStorage
impl Send for NeighborStorage
impl Sync for NeighborStorage
Auto Trait Implementations§
impl Freeze for NeighborStorage
impl RefUnwindSafe for NeighborStorage
impl Unpin for NeighborStorage
impl UnsafeUnpin for NeighborStorage
impl UnwindSafe for NeighborStorage
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