pub struct InMemoryObjectStore { /* private fields */ }Expand description
An in-memory ObjectClient with real ETag and conditional-write
semantics, for building and testing the object-storage backend without a
cloud dependency.
Implementations§
Trait Implementations§
Source§impl Debug for InMemoryObjectStore
impl Debug for InMemoryObjectStore
Source§impl Default for InMemoryObjectStore
impl Default for InMemoryObjectStore
Source§fn default() -> InMemoryObjectStore
fn default() -> InMemoryObjectStore
Returns the “default value” for a type. Read more
Source§impl ObjectClient for InMemoryObjectStore
impl ObjectClient for InMemoryObjectStore
Source§fn get<'op>(&'op self, key: &str) -> ObjectFuture<'op, Option<Arc<[u8]>>>
fn get<'op>(&'op self, key: &str) -> ObjectFuture<'op, Option<Arc<[u8]>>>
Reads the whole object, or
None when the key is absent.Source§fn get_range<'op>(
&'op self,
key: &str,
offset: u64,
len: u64,
) -> ObjectFuture<'op, Arc<[u8]>>
fn get_range<'op>( &'op self, key: &str, offset: u64, len: u64, ) -> ObjectFuture<'op, Arc<[u8]>>
Reads
len bytes starting at offset; errors for an absent key or an
out-of-bounds range.Source§fn put<'op>(&'op self, key: &str, bytes: Arc<[u8]>) -> ObjectFuture<'op, ETag>
fn put<'op>(&'op self, key: &str, bytes: Arc<[u8]>) -> ObjectFuture<'op, ETag>
Stores the object unconditionally, returning its new
ETag.Source§fn delete<'op>(&'op self, key: &str) -> ObjectFuture<'op, ()>
fn delete<'op>(&'op self, key: &str) -> ObjectFuture<'op, ()>
Deletes the object (idempotent: deleting an absent key succeeds).
Source§fn list<'op>(&'op self, prefix: &str) -> ObjectFuture<'op, Vec<ObjectMeta>>
fn list<'op>(&'op self, prefix: &str) -> ObjectFuture<'op, Vec<ObjectMeta>>
Lists objects whose key starts with
prefix, in key order.Source§fn head<'op>(&'op self, key: &str) -> ObjectFuture<'op, Option<ObjectMeta>>
fn head<'op>(&'op self, key: &str) -> ObjectFuture<'op, Option<ObjectMeta>>
Returns the object’s metadata (size +
ETag) without its bytes, or None
when the key is absent (like S3 HEAD).Source§fn put_if<'op>(
&'op self,
key: &str,
bytes: Arc<[u8]>,
precondition: Precondition,
) -> ObjectFuture<'op, PutIf>
fn put_if<'op>( &'op self, key: &str, bytes: Arc<[u8]>, precondition: Precondition, ) -> ObjectFuture<'op, PutIf>
Conditional write (compare-and-swap): stores
bytes only if precondition
holds, otherwise reports PutIf::PreconditionFailed with the current
ETag. This is the manifest commit point; it must be a real CAS.Auto Trait Implementations§
impl !Freeze for InMemoryObjectStore
impl RefUnwindSafe for InMemoryObjectStore
impl Send for InMemoryObjectStore
impl Sync for InMemoryObjectStore
impl Unpin for InMemoryObjectStore
impl UnsafeUnpin for InMemoryObjectStore
impl UnwindSafe for InMemoryObjectStore
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