Trait zarrs::storage::AsyncWritableStorageTraits
source · pub trait AsyncWritableStorageTraits: Send + Sync {
// Required methods
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
value: Bytes
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn set_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_start_values: &'life1 [StoreKeyStartValue<'_>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn erase<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn erase_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn erase_values<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StoreKey]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Available on crate feature
async
only.Expand description
Async writable storage traits.
Required Methods§
sourcefn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
value: Bytes
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey,
value: Bytes
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
sourcefn set_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_start_values: &'life1 [StoreKeyStartValue<'_>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_partial_values<'life0, 'life1, 'async_trait>(
&'life0 self,
key_start_values: &'life1 [StoreKeyStartValue<'_>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Store bytes according to a list of StoreKeyStartValue
.
§Errors
Returns a StorageError
on failure to store.
sourcefn erase<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StoreKey
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Erase a StoreKey
.
Succeeds if the key does not exist.
§Errors
Returns a StorageError
if there is an underlying storage error.
sourcefn erase_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorePrefix
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Erase all StoreKey
under StorePrefix
.
§Errors
Returns a StorageError
if there is an underlying storage error.
Provided Methods§
sourcefn erase_values<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StoreKey]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn erase_values<'life0, 'life1, 'async_trait>(
&'life0 self,
keys: &'life1 [StoreKey]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Implementors§
impl AsyncWritableStorageTraits for AsyncOpendalStore
Available on crate feature
opendal
only.impl<T: ObjectStore> AsyncWritableStorageTraits for AsyncObjectStore<T>
Available on crate feature
object_store
only.