QuantizedVector

Trait QuantizedVector 

Source
pub trait QuantizedVector: Send + Sync {
    // Required methods
    fn quantize(vector: &[f32]) -> Self;
    fn distance(&self, other: &Self) -> f32;
    fn reconstruct(&self) -> Vec<f32>;
}
Expand description

Trait for quantized vector representations

Required Methods§

Source

fn quantize(vector: &[f32]) -> Self

Quantize a full-precision vector

Source

fn distance(&self, other: &Self) -> f32

Calculate distance to another quantized vector

Source

fn reconstruct(&self) -> Vec<f32>

Reconstruct approximate full-precision vector

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§