pub struct HashMapBlobStore { /* private fields */ }Expand description
A blob store that is backed by a hash map with a reference counted value. Used for tests when you need an actual blob store.
Trait Implementations§
Source§impl BlobStore for HashMapBlobStore
impl BlobStore for HashMapBlobStore
Source§fn clone_blob(&mut self, hash: &BlobHash) -> Result<(), NoSuchBlobError>
fn clone_blob(&mut self, hash: &BlobHash) -> Result<(), NoSuchBlobError>
Mark the
hash as used. Read moreSource§fn insert_blob(&mut self, bytes: &[u8]) -> BlobHash
fn insert_blob(&mut self, bytes: &[u8]) -> BlobHash
Insert
bytes into the blob store. Read moreSource§fn retrieve_blob(&self, hash: &BlobHash) -> Result<&[u8], NoSuchBlobError>
fn retrieve_blob(&self, hash: &BlobHash) -> Result<&[u8], NoSuchBlobError>
Returns the bytes stored at the content address
hash.Source§fn free_blob(&mut self, hash: &BlobHash) -> Result<(), NoSuchBlobError>
fn free_blob(&mut self, hash: &BlobHash) -> Result<(), NoSuchBlobError>
Marks the
hash as unused. Read moreSource§fn iter_blobs(&self) -> BlobsIter<'_>
fn iter_blobs(&self) -> BlobsIter<'_>
Iterate over all blobs present in the blob store. Read more
Source§fn bytes_used_by_blobs(&self) -> u64
fn bytes_used_by_blobs(&self) -> u64
Returns the amount of memory in bytes used by blobs in this
BlobStore. Read moreSource§impl Debug for HashMapBlobStore
impl Debug for HashMapBlobStore
Source§impl Default for HashMapBlobStore
impl Default for HashMapBlobStore
Source§fn default() -> HashMapBlobStore
fn default() -> HashMapBlobStore
Returns the “default value” for a type. Read more
Source§impl MemoryUsage for HashMapBlobStore
impl MemoryUsage for HashMapBlobStore
Source§fn heap_usage(&self) -> usize
fn heap_usage(&self) -> usize
The heap memory usage of this type. The default implementation returns 0.
Source§impl PartialEq for HashMapBlobStore
impl PartialEq for HashMapBlobStore
impl Eq for HashMapBlobStore
impl StructuralPartialEq for HashMapBlobStore
Auto Trait Implementations§
impl Freeze for HashMapBlobStore
impl RefUnwindSafe for HashMapBlobStore
impl Send for HashMapBlobStore
impl Sync for HashMapBlobStore
impl Unpin for HashMapBlobStore
impl UnwindSafe for HashMapBlobStore
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more