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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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.