pub struct InMemoryCache { /* private fields */ }Expand description
Hash-map backed cache used by tests and the current MVP pipeline.
§Examples
use mos_cache::{Cache, CacheKey, InMemoryCache};
use mos_core::ContentHash;
let mut cache = InMemoryCache::default();
let key = CacheKey(ContentHash(5));
cache.put(key, b"pdf".to_vec());
assert_eq!(cache.get(&key), Some(b"pdf".to_vec()));Trait Implementations§
Source§impl Cache for InMemoryCache
impl Cache for InMemoryCache
Source§impl Debug for InMemoryCache
impl Debug for InMemoryCache
Source§impl Default for InMemoryCache
impl Default for InMemoryCache
Source§fn default() -> InMemoryCache
fn default() -> InMemoryCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InMemoryCache
impl RefUnwindSafe for InMemoryCache
impl Send for InMemoryCache
impl Sync for InMemoryCache
impl Unpin for InMemoryCache
impl UnsafeUnpin for InMemoryCache
impl UnwindSafe for InMemoryCache
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