pub struct KnnGraph { /* private fields */ }Expand description
Deterministic directed KNN candidate graph in compressed-row form.
This is deliberately not a semantic or domain graph: consumers decide how to interpret, threshold, symmetrize, or add provenance to candidate edges.
Implementations§
Source§impl KnnGraph
impl KnnGraph
Sourcepub fn build(index: &VectorIndex, neighbors: usize) -> Result<Self, SearchError>
pub fn build(index: &VectorIndex, neighbors: usize) -> Result<Self, SearchError>
Builds an approximate directed KNN graph with bounded query workers.
§Errors
Returns a typed query, worker, capacity, or allocation error.
Sourcepub fn build_exact(
index: &VectorIndex,
neighbors: usize,
) -> Result<Self, SearchError>
pub fn build_exact( index: &VectorIndex, neighbors: usize, ) -> Result<Self, SearchError>
Builds an exact directed KNN graph for oracle and small-corpus use.
§Errors
Returns a typed query, worker, capacity, or allocation error.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn edge_count(&self) -> usize
pub fn nodes(&self) -> impl ExactSizeIterator<Item = u64> + '_
pub fn neighbors(&self, source: u64) -> Option<&[NeighborEdge]>
pub fn edges(&self) -> impl ExactSizeIterator<Item = NeighborEdge> + '_
Trait Implementations§
impl StructuralPartialEq for KnnGraph
Auto Trait Implementations§
impl Freeze for KnnGraph
impl RefUnwindSafe for KnnGraph
impl Send for KnnGraph
impl Sync for KnnGraph
impl Unpin for KnnGraph
impl UnsafeUnpin for KnnGraph
impl UnwindSafe for KnnGraph
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