CloudStorageClient

Trait CloudStorageClient 

Source
pub trait CloudStorageClient {
    // Required methods
    fn upload(&self, key: &str, data: &[u8]) -> UtilsResult<String>;
    fn download(&self, key: &str) -> UtilsResult<Vec<u8>>;
    fn delete(&self, key: &str) -> UtilsResult<()>;
    fn list_objects(&self, prefix: &str) -> UtilsResult<Vec<String>>;
    fn exists(&self, key: &str) -> UtilsResult<bool>;
    fn get_metadata(&self, key: &str) -> UtilsResult<ObjectMetadata>;
    fn upload_file(&self, key: &str, local_path: &str) -> UtilsResult<String>;
    fn download_file(&self, key: &str, local_path: &str) -> UtilsResult<()>;
}
Expand description

Cloud storage client trait

Required Methods§

Source

fn upload(&self, key: &str, data: &[u8]) -> UtilsResult<String>

Upload data to cloud storage

Source

fn download(&self, key: &str) -> UtilsResult<Vec<u8>>

Download data from cloud storage

Source

fn delete(&self, key: &str) -> UtilsResult<()>

Delete object from cloud storage

Source

fn list_objects(&self, prefix: &str) -> UtilsResult<Vec<String>>

List objects with prefix

Source

fn exists(&self, key: &str) -> UtilsResult<bool>

Check if object exists

Source

fn get_metadata(&self, key: &str) -> UtilsResult<ObjectMetadata>

Get object metadata

Source

fn upload_file(&self, key: &str, local_path: &str) -> UtilsResult<String>

Upload file from local path

Source

fn download_file(&self, key: &str, local_path: &str) -> UtilsResult<()>

Download file to local path

Implementors§