Datastore

Trait Datastore 

Source
pub trait Datastore: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn put<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
        value: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn has<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<bool, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: Option<&'life1 [u8]>,
    ) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Bytes>, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Key-value datastore interface

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a value by key

Source

fn put<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], value: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Put a key-value pair

Source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete a key

Source

fn has<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<bool, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a key exists

Source

fn query<'life0, 'life1, 'async_trait>( &'life0 self, prefix: Option<&'life1 [u8]>, ) -> Pin<Box<dyn Future<Output = Result<AwaitIterable<Bytes>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query for keys with optional filters

Implementors§