pub trait KeyValueStore: Send + Sync {
// Required methods
fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<KvEntry>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: Bytes,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_keys<'life0, 'async_trait>(
&'life0 self,
opts: ListKeysOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<KeyList>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Object-safe byte-oriented key-value storage.
Required Methods§
Sourcefn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<KvEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_bytes<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<KvEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets a stored byte value.
Sourcefn set_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: Bytes,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: Bytes,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Sets a stored byte value and content type.
Sourcefn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a key, doing nothing when it is absent.
Sourcefn list_keys<'life0, 'async_trait>(
&'life0 self,
opts: ListKeysOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<KeyList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_keys<'life0, 'async_trait>(
&'life0 self,
opts: ListKeysOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<KeyList>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists stored keys.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".