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§
Sourcefn delete(&self, key: &str) -> UtilsResult<()>
fn delete(&self, key: &str) -> UtilsResult<()>
Delete object from cloud storage
Sourcefn list_objects(&self, prefix: &str) -> UtilsResult<Vec<String>>
fn list_objects(&self, prefix: &str) -> UtilsResult<Vec<String>>
List objects with prefix
Sourcefn exists(&self, key: &str) -> UtilsResult<bool>
fn exists(&self, key: &str) -> UtilsResult<bool>
Check if object exists
Sourcefn get_metadata(&self, key: &str) -> UtilsResult<ObjectMetadata>
fn get_metadata(&self, key: &str) -> UtilsResult<ObjectMetadata>
Get object metadata
Sourcefn upload_file(&self, key: &str, local_path: &str) -> UtilsResult<String>
fn upload_file(&self, key: &str, local_path: &str) -> UtilsResult<String>
Upload file from local path
Sourcefn download_file(&self, key: &str, local_path: &str) -> UtilsResult<()>
fn download_file(&self, key: &str, local_path: &str) -> UtilsResult<()>
Download file to local path