VectorOperator

Trait VectorOperator 

Source
pub trait VectorOperator {
    // Required methods
    fn next(&mut self) -> Result<Option<VectorMatch>, VectorError>;
    fn dimension(&self) -> usize;

    // Provided method
    fn collect_all(&mut self) -> Result<Vec<VectorMatch>, VectorError> { ... }
}
Expand description

Trait for vector search operators.

Operators implement an iterator-like interface for streaming vector search results. Unlike standard iterators, the next method returns a Result to handle storage or computation errors.

Required Methods§

Source

fn next(&mut self) -> Result<Option<VectorMatch>, VectorError>

Get the next match from the operator.

Returns Ok(Some(match)) if a match is available, Ok(None) if the operator is exhausted, or Err if an error occurred.

Source

fn dimension(&self) -> usize

Get the dimension of vectors this operator works with.

Provided Methods§

Source

fn collect_all(&mut self) -> Result<Vec<VectorMatch>, VectorError>

Collect all remaining matches into a vector.

This consumes the operator and returns all matches.

Implementors§