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§
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Capabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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,
Get backend capabilities
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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)
Sourcefn 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 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)
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Get object tags
Get bucket tags
Set object tags
Set bucket tags
Delete object tags
Delete bucket tags