pub struct MemoryStore { /* private fields */ }Expand description
Bounded in-memory LRU store.
Eviction is O(n) over the entries when the bound is exceeded, which is fine for the few-thousand-entry caches typical of ISR; plug in a dedicated store for larger working sets.
Implementations§
Trait Implementations§
Source§impl CacheStore for MemoryStore
impl CacheStore for MemoryStore
fn get<'a>( &'a self, key: &'a CacheKey, ) -> Pin<Box<dyn Future<Output = Result<Option<CacheEntry>, CacheError>> + Send + 'a>>
fn set( &self, key: CacheKey, entry: CacheEntry, ) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + '_>>
fn delete<'a>( &'a self, key: &'a CacheKey, ) -> Pin<Box<dyn Future<Output = Result<bool, CacheError>> + Send + 'a>>
Source§fn delete_tag<'a>(
&'a self,
tag: &'a str,
) -> Pin<Box<dyn Future<Output = Result<usize, CacheError>> + Send + 'a>>
fn delete_tag<'a>( &'a self, tag: &'a str, ) -> Pin<Box<dyn Future<Output = Result<usize, CacheError>> + Send + 'a>>
Delete every entry carrying
tag; returns the number removed.fn clear( &self, ) -> Pin<Box<dyn Future<Output = Result<(), CacheError>> + Send + '_>>
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl Forget for MemoryStore
impl Move for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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