Trait zarrs::storage::AsyncListableStorageTraits

source ·
pub trait AsyncListableStorageTraits: Send + Sync {
    // Required methods
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_prefix<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 StorePrefix,
    ) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_dir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 StorePrefix,
    ) -> Pin<Box<dyn Future<Output = Result<StoreKeysPrefixes, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn size_prefix<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 StorePrefix,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn size<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature async only.
Expand description

Async listable storage traits.

Required Methods§

source

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieve all StoreKeys in the store.

§Errors

Returns a StorageError if there is an underlying error with the store.

source

fn list_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 StorePrefix, ) -> Pin<Box<dyn Future<Output = Result<StoreKeys, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve all StoreKeys with a given StorePrefix.

§Errors

Returns a StorageError if the prefix is not a directory or there is an underlying error with the store.

source

fn list_dir<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 StorePrefix, ) -> Pin<Box<dyn Future<Output = Result<StoreKeysPrefixes, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve all StoreKeys and StorePrefix which are direct children of StorePrefix.

§Errors

Returns a StorageError if the prefix is not a directory or there is an underlying error with the store.

source

fn size_prefix<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 StorePrefix, ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the size in bytes of all keys under prefix.

§Errors

Returns a StorageError if the store does not support size() or there is an underlying error with the store.

Provided Methods§

source

fn size<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return the size in bytes of the storage.

§Errors

Returns a StorageError if the store does not support size() or there is an underlying error with the store.

Implementors§

source§

impl AsyncListableStorageTraits for AsyncOpendalStore

Available on crate feature opendal only.
source§

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

Available on crate feature object_store only.
source§

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