pub struct MemoryBlob { /* private fields */ }Expand description
An in-memory cratefield_core::Blob store for module tests: keeps objects
in a map, and has no presigned URLs (so signed_url reports Unsupported,
as a directory store does).
Implementations§
Trait Implementations§
Source§impl Blob for MemoryBlob
impl Blob for MemoryBlob
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.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 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 URL that serves the object directly for
ttl, skipping the Worker.
Adapters without presigned URLs (a directory store) return
BlobError::Unsupported; callers then serve the bytes through
get.Source§impl Clone for MemoryBlob
impl Clone for MemoryBlob
Source§fn clone(&self) -> MemoryBlob
fn clone(&self) -> MemoryBlob
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryBlob
impl Default for MemoryBlob
Source§fn default() -> MemoryBlob
fn default() -> MemoryBlob
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryBlob
impl RefUnwindSafe for MemoryBlob
impl Send for MemoryBlob
impl Sync for MemoryBlob
impl Unpin for MemoryBlob
impl UnsafeUnpin for MemoryBlob
impl UnwindSafe for MemoryBlob
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