KeyValueBucket

Trait KeyValueBucket 

Source
pub trait KeyValueBucket: Send + Sync {
    // Required methods
    fn insert<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 Key,
        value: Bytes,
        revision: u64,
    ) -> Pin<Box<dyn Future<Output = Result<StoreOutcome, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 Key,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Bytes>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 Key,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn watch<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = WatchEvent> + Send + '_>>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn entries<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Bytes>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

An online storage for key-value config values.

Required Methods§

Source

fn insert<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 Key, value: Bytes, revision: u64, ) -> Pin<Box<dyn Future<Output = Result<StoreOutcome, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

A bucket is a collection of key/value pairs. Insert a value into a bucket, if it doesn’t exist already

Source

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

Fetch an item from the key-value storage

Source

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

Delete an item from the bucket

Source

fn watch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = WatchEvent> + Send + '_>>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

A stream of items inserted into the bucket. Every time the stream is polled it will either return a newly created entry, or block until such time.

Source

fn entries<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, Bytes>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§