pub trait BlobAdapter:
Debug
+ Send
+ Sync {
// Required methods
fn create_blob_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
data: &'life2 [u8],
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn create_blob_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
stream: &'life2 mut (dyn AsyncRead + Send + Unpin),
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn stat_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BlobStat>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_blob_buf<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_blob_range_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
offset: u64,
length: u64,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn read_blob_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_blob_from_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
source: &'life2 Path,
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn delete_tenant_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = ClResult<String>> + Send>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn cleanup_tmp_files<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
cutoff_secs: i64,
) -> Pin<Box<dyn Future<Output = ClResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn create_blob_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
data: &'life2 [u8],
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_blob_buf<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
data: &'life2 [u8],
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Creates a new blob from a buffer
Sourcefn create_blob_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
stream: &'life2 mut (dyn AsyncRead + Send + Unpin),
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_blob_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
stream: &'life2 mut (dyn AsyncRead + Send + Unpin),
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Creates a new blob using a stream
Sourcefn stat_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BlobStat>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stat_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BlobStat>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stats a blob. Returns None if the blob is not present.
Sourcefn read_blob_buf<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_blob_buf<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Box<[u8]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a blob
Sourcefn read_blob_range_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
offset: u64,
length: u64,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_blob_range_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
offset: u64,
length: u64,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a byte range from a blob as a stream (no full buffering).
offset is the start byte; length is the number of bytes to read.
Sourcefn read_blob_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_blob_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads a blob
Sourcefn create_blob_from_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
source: &'life2 Path,
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_blob_from_path<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tn_id: TnId,
file_id: &'life1 str,
source: &'life2 Path,
opts: &'life3 CreateBlobOptions,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Creates a new blob by copying a file from a local path (no memory allocation)
Sourcefn delete_tenant_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_tenant_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete every blob owned by the tenant. Treats a missing tenant directory as success. Used by tenant purge orchestration.
Sourcefn delete_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_blob<'life0, 'life1, 'async_trait>(
&'life0 self,
tn_id: TnId,
blob_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = ClResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a single blob. Missing blob is success (idempotent).
Sourcefn list_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = ClResult<String>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_blobs<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
) -> Pin<Box<dyn Future<Output = ClResult<Pin<Box<dyn Stream<Item = ClResult<String>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Enumerate every blob_id (typically a variant_id) currently present
in this tenant’s blob store. Used by the GC scanner.
Sourcefn cleanup_tmp_files<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
cutoff_secs: i64,
) -> Pin<Box<dyn Future<Output = ClResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_tmp_files<'life0, 'async_trait>(
&'life0 self,
tn_id: TnId,
cutoff_secs: i64,
) -> Pin<Box<dyn Future<Output = ClResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete in-progress upload artifacts whose mtime is at or before
cutoff_secs (Unix epoch seconds). These are written outside the
content-addressed xx/yy/ shards by create_blob_stream, so they
are invisible to list_blobs. Returns the number of files removed.
Adapters with no notion of tmp files may return Ok(0).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".