Trait lance_index::vector::graph::Graph

source ·
pub trait Graph {
    // Required methods
    fn len(&self) -> usize;
    fn neighbors(&self, key: u32) -> Option<Box<dyn Iterator<Item = u32> + '_>>;
    fn storage(&self) -> Arc<dyn VectorStorage>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Graph trait.

§Type parameters

K: Vertex Index type T: the data type of vector, i.e., f32 or f16.

Required Methods§

source

fn len(&self) -> usize

Get the number of nodes in the graph.

source

fn neighbors(&self, key: u32) -> Option<Box<dyn Iterator<Item = u32> + '_>>

Get the neighbors of a graph node, identifyied by the index.

source

fn storage(&self) -> Arc<dyn VectorStorage>

Access to underline storage

Provided Methods§

source

fn is_empty(&self) -> bool

Returns true if the graph is empty.

Implementors§