Skip to main content

ObjectStore

Trait ObjectStore 

Source
pub trait ObjectStore: Send + Sync {
Show 23 methods // Required methods fn list_buckets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectInfo>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_objects<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, options: ListOptions, ) -> Pin<Box<dyn Future<Output = Result<ListResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn head_object<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn bucket_exists<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn create_bucket<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_bucket<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn capabilities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Capabilities>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_object<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn put_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 RemotePath, data: Vec<u8>, content_type: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn delete_object<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_objects<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, keys: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn copy_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 RemotePath, dst: &'life2 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn presign_get<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, expires_secs: u64, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn presign_put<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 RemotePath, expires_secs: u64, content_type: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_versioning<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<bool>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_versioning<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, enabled: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn list_object_versions<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, max_keys: Option<i32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectVersion>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_bucket_tags<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, tags: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn set_bucket_tags<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, tags: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_bucket_tags<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

Trait for S3-compatible storage operations

This trait is implemented by the S3 adapter and can be mocked for testing.

Required Methods§

Source

fn list_buckets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List buckets

Source

fn list_objects<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, options: ListOptions, ) -> Pin<Box<dyn Future<Output = Result<ListResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List objects in a bucket or prefix

Source

fn head_object<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get object metadata

Source

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

Check if a bucket exists

Source

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

Create a bucket

Source

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

Delete a bucket

Source

fn capabilities<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Capabilities>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get backend capabilities

Source

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

Get object content as bytes

Source

fn put_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 RemotePath, data: Vec<u8>, content_type: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Upload object from bytes

Source

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

Delete an object

Source

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

Delete multiple objects (batch delete)

Source

fn copy_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src: &'life1 RemotePath, dst: &'life2 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<ObjectInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Copy object within S3 (server-side copy)

Source

fn presign_get<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, expires_secs: u64, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generate a presigned URL for an object

Source

fn presign_put<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 RemotePath, expires_secs: u64, content_type: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Generate a presigned URL for uploading an object

Source

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

Get bucket versioning status

Source

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

Set bucket versioning status

Source

fn list_object_versions<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, max_keys: Option<i32>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectVersion>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List object versions

Source

fn get_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get object tags

Source

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

Get bucket tags

Source

fn set_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, tags: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set object tags

Source

fn set_bucket_tags<'life0, 'life1, 'async_trait>( &'life0 self, bucket: &'life1 str, tags: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Set bucket tags

Source

fn delete_object_tags<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 RemotePath, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete object tags

Source

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

Delete bucket tags

Implementors§