pub struct DigestCache { /* private fields */ }Implementations§
Source§impl DigestCache
impl DigestCache
pub fn open(dir: &Path) -> Result<DigestCache, StorageError>
Sourcepub fn put(
&mut self,
content: &B3Hash,
tree_json: &[u8],
) -> Result<(), StorageError>
pub fn put( &mut self, content: &B3Hash, tree_json: &[u8], ) -> Result<(), StorageError>
Stores a digest for content that has none. Content already digested is left exactly as it was — same address, same bytes, nothing to decide.
pub fn get(&self, content: &B3Hash) -> Result<Option<Vec<u8>>, StorageError>
Sourcepub fn invalidate(
&mut self,
content: &B3Hash,
reason: &str,
) -> Result<Payload, StorageError>
pub fn invalidate( &mut self, content: &B3Hash, reason: &str, ) -> Result<Payload, StorageError>
Drops an entry and returns the digest_invalidated payload. The
next digest of this content re-runs; invalidating something that
was never cached is not an error, because the end state is the
one the caller asked for.
Auto Trait Implementations§
impl Freeze for DigestCache
impl RefUnwindSafe for DigestCache
impl Send for DigestCache
impl Sync for DigestCache
impl Unpin for DigestCache
impl UnsafeUnpin for DigestCache
impl UnwindSafe for DigestCache
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