Skip to main content

IndexStorage

Trait IndexStorage 

Source
pub trait IndexStorage: Send + Sync {
    // Required methods
    fn save_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 NamespaceId,
        index_type: IndexType,
        data: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 NamespaceId,
        index_type: IndexType,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 NamespaceId,
        index_type: IndexType,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn index_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 NamespaceId,
        index_type: IndexType,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_indexes<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 NamespaceId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<IndexType>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Storage trait for persisting index data

Required Methods§

Source

fn save_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save index data for a namespace

Source

fn load_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load index data for a namespace

Source

fn delete_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete index data for a namespace

Source

fn index_exists<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if index exists for a namespace

Source

fn list_indexes<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, ) -> Pin<Box<dyn Future<Output = Result<Vec<IndexType>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all indexes for a namespace

Implementations on Foreign Types§

Source§

impl<T: IndexStorage + ?Sized> IndexStorage for Arc<T>

Blanket implementation for Arc

Source§

fn save_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, data: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn load_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn delete_index<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn index_exists<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, index_type: IndexType, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn list_indexes<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 NamespaceId, ) -> Pin<Box<dyn Future<Output = Result<Vec<IndexType>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§