Skip to main content

StorageClient

Trait StorageClient 

Source
pub trait StorageClient: Send + Sync {
    // Required methods
    fn list(&self, prefix_or_path: &str) -> FloeResult<Vec<ObjectRef>>;
    fn download_to_temp(
        &self,
        uri: &str,
        temp_dir: &Path,
    ) -> FloeResult<PathBuf>;
    fn upload_from_path(&self, local_path: &Path, uri: &str) -> FloeResult<()>;
    fn resolve_uri(&self, path: &str) -> FloeResult<String>;
    fn copy_object(&self, src_uri: &str, dst_uri: &str) -> FloeResult<()>;
    fn delete_object(&self, uri: &str) -> FloeResult<()>;
    fn exists(&self, uri: &str) -> FloeResult<bool>;

    // Provided methods
    fn read_object(&self, uri: &str) -> FloeResult<Option<StoredObject>> { ... }
    fn write_object_conditional(
        &self,
        uri: &str,
        expected_version: Option<&str>,
        body: &[u8],
    ) -> FloeResult<ConditionalWrite> { ... }
    fn delete_object_conditional(
        &self,
        uri: &str,
        expected_version: Option<&str>,
    ) -> FloeResult<ConditionalWrite> { ... }
}

Required Methods§

Source

fn list(&self, prefix_or_path: &str) -> FloeResult<Vec<ObjectRef>>

Source

fn download_to_temp(&self, uri: &str, temp_dir: &Path) -> FloeResult<PathBuf>

Source

fn upload_from_path(&self, local_path: &Path, uri: &str) -> FloeResult<()>

Source

fn resolve_uri(&self, path: &str) -> FloeResult<String>

Source

fn copy_object(&self, src_uri: &str, dst_uri: &str) -> FloeResult<()>

Source

fn delete_object(&self, uri: &str) -> FloeResult<()>

Source

fn exists(&self, uri: &str) -> FloeResult<bool>

Provided Methods§

Source

fn read_object(&self, uri: &str) -> FloeResult<Option<StoredObject>>

Source

fn write_object_conditional( &self, uri: &str, expected_version: Option<&str>, body: &[u8], ) -> FloeResult<ConditionalWrite>

Source

fn delete_object_conditional( &self, uri: &str, expected_version: Option<&str>, ) -> FloeResult<ConditionalWrite>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§