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§

source

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,

Store bytes at a StoreKey.

§Errors

Returns a StorageError on failure to store.

source

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.

source

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.

source

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§

source

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,

Erase a list of StoreKey.

§Errors

Returns a StorageError if there is an underlying storage error.

Implementors§

source§

impl AsyncWritableStorageTraits for AsyncOpendalStore

Available on crate feature opendal only.
source§

impl<T: ObjectStore> AsyncWritableStorageTraits for AsyncObjectStore<T>

Available on crate feature object_store only.
source§

impl<TStorage: ?Sized + AsyncWritableStorageTraits> AsyncWritableStorageTraits for StorageHandle<TStorage>