pub struct MemoryCappedHashmap { /* private fields */ }
Expand description
An LRU cache with hash map backing and an eviction rule based on the memory usage for object data in bytes.
Implementations
sourceimpl MemoryCappedHashmap
impl MemoryCappedHashmap
sourcepub fn capacity(&self) -> usize
Available on crate feature object-cache-dynamic
only.
pub fn capacity(&self) -> usize
object-cache-dynamic
only.The amount of bytes we can hold in total, or the value we saw in new(…)
.
sourcepub fn new(memory_cap_in_bytes: usize) -> MemoryCappedHashmap
Available on crate feature object-cache-dynamic
only.
pub fn new(memory_cap_in_bytes: usize) -> MemoryCappedHashmap
object-cache-dynamic
only.Return a new instance which evicts least recently used items if it uses more than memory_cap_in_bytes
object data.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MemoryCappedHashmap
impl Send for MemoryCappedHashmap
impl !Sync for MemoryCappedHashmap
impl Unpin for MemoryCappedHashmap
impl UnwindSafe for MemoryCappedHashmap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more