Trait ANNIndexOwned

Source
pub trait ANNIndexOwned<const N: usize> {
    // Required methods
    fn insert_with_rng(
        &mut self,
        vector: Vector<N>,
        id: usize,
        rng: &mut impl Rng,
    );
    fn delete_by_id(&mut self, id: usize);
    fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<(usize, f32)>;

    // Provided method
    fn insert(&mut self, vector: Vector<N>, id: usize) { ... }
}

Required Methods§

Source

fn insert_with_rng(&mut self, vector: Vector<N>, id: usize, rng: &mut impl Rng)

Insert a vector into the index with a custom rng.

Source

fn delete_by_id(&mut self, id: usize)

Delete a vector from the index by id.

Source

fn search(&self, query: &Vector<N>, top_k: usize) -> Vec<(usize, f32)>

Search for the top_k nearest neighbors of the query vector.

Provided Methods§

Source

fn insert(&mut self, vector: Vector<N>, id: usize)

Insert a vector into the index.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const N: usize> ANNIndexOwned<N> for VectorLite<N>