KeyValueStore

Trait KeyValueStore 

Source
pub trait KeyValueStore:
    Debug
    + Send
    + Sync
    + DynClone {
    // Required methods
    fn new<'async_trait>(
        location: PathBuf,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn partition<'life0, 'async_trait>(
        &'life0 self,
        location: PathBuf,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn KeyValueStore>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_partition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        location: &'life1 Path,
    ) -> Pin<Box<dyn Future<Output = Option<Box<dyn KeyValueStore>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn clear<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 [u8],
        value: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<KeyValue, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn keys<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn values<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<u8>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn location(&self) -> PathBuf;
}

Required Methods§

Source

fn new<'async_trait>( location: PathBuf, ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Source

fn partition<'life0, 'async_trait>( &'life0 self, location: PathBuf, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn KeyValueStore>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_partition<'life0, 'life1, 'async_trait>( &'life0 self, location: &'life1 Path, ) -> Pin<Box<dyn Future<Output = Option<Box<dyn KeyValueStore>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

fn location(&self) -> PathBuf

Implementors§