pub struct InMemoryBlobStore { /* private fields */ }Expand description
Arc<RwLock<HashMap<Digest, Bytes>>> reference implementation.
Cheap to clone; multiple handles share the same backing map. Useful for tests, ephemeral caches, and a baseline for performance comparison against custom backends.
Implementations§
Trait Implementations§
Source§impl BlobStore for InMemoryBlobStore
impl BlobStore for InMemoryBlobStore
Source§fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
bytes: Bytes,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write
bytes under digest. See trait-level documentation
for atomicity and digest-verification requirements.Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the bytes stored under
digest. Read moreSource§fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait>(
&'life0 self,
digest: &'life1 Digest,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check for blob presence without fetching the body.
Source§impl Clone for InMemoryBlobStore
impl Clone for InMemoryBlobStore
Source§fn clone(&self) -> InMemoryBlobStore
fn clone(&self) -> InMemoryBlobStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryBlobStore
impl Debug for InMemoryBlobStore
Source§impl Default for InMemoryBlobStore
impl Default for InMemoryBlobStore
Source§fn default() -> InMemoryBlobStore
fn default() -> InMemoryBlobStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InMemoryBlobStore
impl RefUnwindSafe for InMemoryBlobStore
impl Send for InMemoryBlobStore
impl Sync for InMemoryBlobStore
impl Unpin for InMemoryBlobStore
impl UnsafeUnpin for InMemoryBlobStore
impl UnwindSafe for InMemoryBlobStore
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