pub struct DirBlob { /* private fields */ }Expand description
Stores blobs as files under base.
Implementations§
Trait Implementations§
Source§impl Blob for DirBlob
impl Blob for DirBlob
Source§fn signed_url<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
_ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<String, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn signed_url<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
_ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<String, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
A directory store has no presigned URLs: neither a GET nor (through
the trait default) a PUT.
Source§fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: &'life2 [u8],
content_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
key: &'life1 str,
bytes: &'life2 [u8],
content_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Stores
bytes at key with content_type, replacing any existing
object. Implementations MUST reject a payload larger than
MAX_BLOB_BYTES with BlobError::TooLarge via
check_blob_size, before writing (issue #136).Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobObject>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobObject>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches the object at
key, or None if there is none.Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes the object at
key. Idempotent: removing a missing key is Ok.Source§fn put_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: BoxStream<'static, Result<Bytes, StreamError>>,
content_type: &'life2 str,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<u64, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
body: BoxStream<'static, Result<Bytes, StreamError>>,
content_type: &'life2 str,
max_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<u64, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stores a streamed body at
key (issue #586), for an object larger
than the MAX_BLOB_BYTES buffered path allows, and returns the
number of bytes written. max_bytes is the caller’s ceiling;
adapters MUST enforce it (typically by wrapping body in
limit_stream) and, once it is passed, answer
BlobError::TooLarge and leave no object behind. Read moreSource§fn get_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobStream>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobStream>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches the object at
key as a stream (issue #586), or None if
there is none. The size and content type are known before the body
is read, so a handler can set headers and hand the body on without
buffering it. Read moreSource§fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobMeta>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<BlobMeta>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reports the object’s metadata without reading its bytes (issue
#586), or
None if there is none. Read moreSource§fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
cursor: Option<&'life2 str>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<BlobPage, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn list<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
cursor: Option<&'life2 str>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<BlobPage, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Lists stored objects whose key starts with
prefix (issue #586),
newest page at a time. Keys are returned in lexicographic order;
cursor is the opaque token from the previous BlobPage, or
None to start at the beginning. Adapters cap limit at
MAX_LIST_LIMIT. Read moreSource§fn create_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadId, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
content_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadId, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Starts a multipart upload for
key with content_type (issue
#586) and returns its id. Parts are then written with
upload_part and the object is made visible
by complete_multipart; an upload the
module abandons must be abort_multiparted,
or reclaimed by an R2 lifecycle rule, or its parts linger. Read moreSource§fn upload_part<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
part_number: u16,
body: BoxStream<'static, Result<Bytes, StreamError>>,
max_part_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<PartReceipt, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_part<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
part_number: u16,
body: BoxStream<'static, Result<Bytes, StreamError>>,
max_part_bytes: u64,
) -> Pin<Box<dyn Future<Output = Result<PartReceipt, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Uploads one part of a multipart upload (issue #586),
1 ..= MAX_MULTIPART_PARTS, and returns its PartReceipt.
max_part_bytes is the caller’s ceiling, enforced like
put_stream’s. Every part but the last listed
in complete_multipart must be at
least MIN_MULTIPART_PART_BYTES; adapters may enforce it at
complete, when the last part is known. Read moreSource§fn complete_multipart<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
parts: &'life3 [PartReceipt],
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn complete_multipart<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
parts: &'life3 [PartReceipt],
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Assembles the parts listed in
parts (in ascending part order)
into the object at key and ends the upload (issue #586). A part
whose ETag does not match what was uploaded is refused; an
unknown upload id is BlobError::Operation. Read moreSource§fn abort_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn abort_multipart<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
upload_id: &'life2 UploadId,
) -> Pin<Box<dyn Future<Output = Result<(), BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Abandons a multipart upload (issue #586), discarding its parts. An
unknown upload id is
BlobError::Operation. Read moreSource§fn list_multipart_uploads<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingUpload>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_multipart_uploads<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PendingUpload>, BlobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists the module’s multipart uploads in flight whose key starts
with
prefix (issue #586), so it can abort the ones it abandoned. Read moreSource§fn signed_put_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
content_type: &'life2 str,
content_length: Option<u64>,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<PresignedPut, BlobError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn signed_put_url<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
content_type: &'life2 str,
content_length: Option<u64>,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<PresignedPut, BlobError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations§
impl Freeze for DirBlob
impl RefUnwindSafe for DirBlob
impl Send for DirBlob
impl Sync for DirBlob
impl Unpin for DirBlob
impl UnsafeUnpin for DirBlob
impl UnwindSafe for DirBlob
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more