QuantizerStorage

Trait QuantizerStorage 

Source
pub trait QuantizerStorage:
    Clone
    + Sized
    + DeepSizeOf
    + VectorStore {
    type Metadata: QuantizerMetadata;

    // Required methods
    fn try_from_batch(
        batch: RecordBatch,
        metadata: &Self::Metadata,
        distance_type: DistanceType,
        frag_reuse_index: Option<Arc<FragReuseIndex>>,
    ) -> Result<Self>;
    fn metadata(&self) -> &Self::Metadata;
    fn load_partition<'life0, 'life1, 'async_trait>(
        reader: &'life0 PreviousFileReader,
        range: Range<usize>,
        distance_type: DistanceType,
        metadata: &'life1 Self::Metadata,
        frag_reuse_index: Option<Arc<FragReuseIndex>>,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn remap(&self, mapping: &HashMap<u64, Option<u64>>) -> Result<Self> { ... }
}

Required Associated Types§

Required Methods§

Source

fn try_from_batch( batch: RecordBatch, metadata: &Self::Metadata, distance_type: DistanceType, frag_reuse_index: Option<Arc<FragReuseIndex>>, ) -> Result<Self>

Create a QuantizerStorage from a RecordBatch. The batch should consist of row IDs and quantized vector.

Source

fn metadata(&self) -> &Self::Metadata

Source

fn load_partition<'life0, 'life1, 'async_trait>( reader: &'life0 PreviousFileReader, range: Range<usize>, distance_type: DistanceType, metadata: &'life1 Self::Metadata, frag_reuse_index: Option<Arc<FragReuseIndex>>, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn remap(&self, mapping: &HashMap<u64, Option<u64>>) -> Result<Self>

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§