Skip to main content

VectorAccessor

Trait VectorAccessor 

Source
pub trait VectorAccessor: Send + Sync {
    // Required method
    fn get_vector(&self, id: NodeId) -> Option<Arc<[f32]>>;
}
Expand description

Trait for reading vectors by node ID.

HNSW is topology-only: vectors live in property storage, not in HNSW nodes. This trait provides the bridge for reading them.

Required Methods§

Source

fn get_vector(&self, id: NodeId) -> Option<Arc<[f32]>>

Returns the vector associated with the given node ID, if it exists.

Implementors§

Source§

impl VectorAccessor for PropertyVectorAccessor<'_>

Source§

impl<F> VectorAccessor for F
where F: Fn(NodeId) -> Option<Arc<[f32]>> + Send + Sync,

Blanket implementation for closures, useful in tests.