pub trait Bucket: 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<Key, 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 The Key should be the name of the item, not including the bucket name.
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 The Key should be the name of the item, not including the bucket name.
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 The Key should be the name of the item, not including the bucket name.
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.
Sourcefn entries<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HashMap<Key, Bytes>, 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<Key, Bytes>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The entries in this bucket.
The Key includes the full path including the bucket name.
That means you cannot directory get a Key from entries and pass it to get or delete.