Skip to main content

CloudStorageBackend

Trait CloudStorageBackend 

Source
pub trait CloudStorageBackend: Send + Sync {
    // Required methods
    fn upload_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        options: TransferOptions,
    ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn download_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 Path,
        options: TransferOptions,
    ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn upload_data<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        data: &'life1 [u8],
        key: &'life2 str,
        options: TransferOptions,
    ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_metadata<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn object_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_objects<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        prefix: Option<&'life1 str>,
        continuation_token: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<ListResult, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn copy_object<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        source_key: &'life1 str,
        dest_key: &'life2 str,
        options: TransferOptions,
    ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn generate_presigned_url<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        expiration: Duration,
        method: HttpMethod,
    ) -> Pin<Box<dyn Future<Output = Result<String, CloudError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Cloud storage backend trait

Required Methods§

Source

fn upload_file<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, options: TransferOptions, ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload a file to cloud storage

Source

fn download_file<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 Path, options: TransferOptions, ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Download a file from cloud storage

Source

fn upload_data<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, data: &'life1 [u8], key: &'life2 str, options: TransferOptions, ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Upload data from memory

Source

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

Download data to memory

Source

fn get_metadata<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get object metadata

Source

fn object_exists<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if object exists

Source

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

Delete an object

Source

fn list_objects<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, prefix: Option<&'life1 str>, continuation_token: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<ListResult, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

List objects with optional prefix

Source

fn copy_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, source_key: &'life1 str, dest_key: &'life2 str, options: TransferOptions, ) -> Pin<Box<dyn Future<Output = Result<CloudObjectMetadata, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Copy an object within the same bucket

Source

fn generate_presigned_url<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, expiration: Duration, method: HttpMethod, ) -> Pin<Box<dyn Future<Output = Result<String, CloudError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a presigned URL for temporary access

Implementors§