pub struct MemStore { /* private fields */ }Expand description
Primary in-memory implementation (also the dev/test runtime).
Implementations§
Trait Implementations§
Source§impl ChunkStore for MemStore
impl ChunkStore for MemStore
Source§fn put(&mut self, data: &[u8]) -> Result<ContentHash, StoreError>
fn put(&mut self, data: &[u8]) -> Result<ContentHash, StoreError>
Stores
data and returns its content address. Idempotent.Source§fn get(&self, hash: &ContentHash) -> Result<Vec<u8>, StoreError>
fn get(&self, hash: &ContentHash) -> Result<Vec<u8>, StoreError>
Retrieves the bytes for
hash, verifying them against the address.Source§fn has(&self, hash: &ContentHash) -> bool
fn has(&self, hash: &ContentHash) -> bool
Whether
hash is present.Auto Trait Implementations§
impl Freeze for MemStore
impl RefUnwindSafe for MemStore
impl Send for MemStore
impl Sync for MemStore
impl Unpin for MemStore
impl UnsafeUnpin for MemStore
impl UnwindSafe for MemStore
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