pub struct InMemoryStore<K, V>{ /* private fields */ }Expand description
A simple in-memory BackingStore backed by a HashMap.
Useful for testing and as a reference implementation.
Implementations§
Source§impl<K, V> InMemoryStore<K, V>
impl<K, V> InMemoryStore<K, V>
Sourcepub fn with_capacity(max_entries: usize) -> Self
pub fn with_capacity(max_entries: usize) -> Self
Create an in-memory store with a hard capacity limit.
Sourcepub fn write_count(&self) -> u64
pub fn write_count(&self) -> u64
Total number of write operations performed.
Sourcepub fn read_count(&self) -> u64
pub fn read_count(&self) -> u64
Total number of read operations performed.
Trait Implementations§
Source§impl<K, V> BackingStore<K, V> for InMemoryStore<K, V>
impl<K, V> BackingStore<K, V> for InMemoryStore<K, V>
Source§impl<K, V> Clone for InMemoryStore<K, V>
impl<K, V> Clone for InMemoryStore<K, V>
Source§fn clone(&self) -> InMemoryStore<K, V>
fn clone(&self) -> InMemoryStore<K, V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V> Debug for InMemoryStore<K, V>
impl<K, V> Debug for InMemoryStore<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for InMemoryStore<K, V>
impl<K, V> RefUnwindSafe for InMemoryStore<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for InMemoryStore<K, V>
impl<K, V> Sync for InMemoryStore<K, V>
impl<K, V> Unpin for InMemoryStore<K, V>
impl<K, V> UnsafeUnpin for InMemoryStore<K, V>
impl<K, V> UnwindSafe for InMemoryStore<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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