Skip to main content

VectorIndex

Trait VectorIndex 

Source
pub trait VectorIndex: Send + Sync {
    // Required methods
    fn descriptor(&self) -> &VectorIndexDescriptor;
    fn status(&self) -> VectorIndexStatus;
    fn replace_partition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partition: &'life1 str,
        records: Vec<VectorRecord>,
    ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove_partition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        partition: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn search<'life0, 'async_trait>(
        &'life0 self,
        request: VectorSearchRequest,
    ) -> Pin<Box<dyn Future<Output = VectorResult<VectorSearchResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A bounded vector index whose content and lifecycle are owned by its caller.

Partitions are the atomic mutation unit. Implementations must make a successful replacement visible in one revision and must not expose a partially constructed partition to concurrent searches.

Required Methods§

Source

fn descriptor(&self) -> &VectorIndexDescriptor

Return the immutable shape and resource limits of this index.

Source

fn status(&self) -> VectorIndexStatus

Return the latest published status without waiting for background work.

Source

fn replace_partition<'life0, 'life1, 'async_trait>( &'life0 self, partition: &'life1 str, records: Vec<VectorRecord>, ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically replace every record in partition.

Replacing an existing partition with an empty record list removes it. Replacing a missing partition with an empty list is a no-op.

Source

fn remove_partition<'life0, 'life1, 'async_trait>( &'life0 self, partition: &'life1 str, ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically remove one partition. Missing partitions are a no-op.

Source

fn search<'life0, 'async_trait>( &'life0 self, request: VectorSearchRequest, ) -> Pin<Box<dyn Future<Output = VectorResult<VectorSearchResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search one immutable index revision.

Source

fn clear<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = VectorResult<VectorIndexStatus>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Remove every partition. Clearing an empty index is a no-op.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§