Skip to main content

StorageClient

Trait StorageClient 

Source
pub trait StorageClient: Send + Sync {
    // Required methods
    fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
        data: &'life3 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn list<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        prefix: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Object-storage client abstraction (e.g. S3, MinIO).

Required Methods§

Source

fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, data: &'life3 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Upload data under key in bucket.

Source

fn get<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Download the object at key in bucket.

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete the object at key in bucket.

Source

fn list<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, prefix: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

List object keys in bucket under prefix.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§