pub struct MemoryCache { /* private fields */ }Expand description
Bounded in-memory cache.
When entries exceed max_entries, the oldest are evicted FIFO to keep the
deterministic cache from growing without bound.
Implementations§
Source§impl MemoryCache
impl MemoryCache
Sourcepub fn with_capacity(max_entries: usize) -> Self
pub fn with_capacity(max_entries: usize) -> Self
Sets the maximum entry count (at least 1).
Trait Implementations§
Source§impl Default for MemoryCache
impl Default for MemoryCache
Source§fn default() -> MemoryCache
fn default() -> MemoryCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryCache
impl RefUnwindSafe for MemoryCache
impl Send for MemoryCache
impl Sync for MemoryCache
impl Unpin for MemoryCache
impl UnsafeUnpin for MemoryCache
impl UnwindSafe for MemoryCache
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