Index

Trait Index 

Source
pub trait Index: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn index_type(&self) -> IndexType;
    fn insert<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        value: &'life1 str,
        document_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn remove<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        value: &'life1 str,
        document_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        value: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn values<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stats<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<IndexStats, IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Index trait for different index implementations

Required Methods§

Source

fn name(&self) -> &str

Get the index name

Source

fn index_type(&self) -> IndexType

Get the index type

Source

fn insert<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, value: &'life1 str, document_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Insert a value with associated document ID

Source

fn remove<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, value: &'life1 str, document_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), IndexError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove a value-document association

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, value: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get document IDs for a value

Source

fn values<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all values in the index

Source

fn stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<IndexStats, IndexError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get index statistics

Source

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

Clear the index

Implementors§