Trait ockam_node::storage::KeyValueStorage
source · pub trait KeyValueStorage<K, V>: Sync + Send + 'static {
// Required methods
fn put<'life0, 'async_trait>(
&'life0 self,
key: K,
value: V
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Option<V>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
This trait defines a key/value storage
Required Methods§
sourcefn put<'life0, 'async_trait>(
&'life0 self,
key: K,
value: V
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>( &'life0 self, key: K, value: V ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Store a key / value