pub type HashMapStateStore<K, S = DefaultHasher> = Mutex<HashMap<K, InMemoryState, S>>;Expand description
A thread-safe (but not very performant) implementation of a keyed rate limiter state
store using HashMap.
The HashMapStateStore is the default state store in std when no other thread-safe
features are enabled.
Aliased Type§
pub struct HashMapStateStore<K, S = DefaultHasher> { /* private fields */ }Trait Implementations§
Source§impl<K: Hash + Eq + Clone, S: BuildHasher> ShrinkableKeyedStateStore<K> for HashMapStateStore<K, S>
impl<K: Hash + Eq + Clone, S: BuildHasher> ShrinkableKeyedStateStore<K> for HashMapStateStore<K, S>
Source§fn retain_recent(&self, drop_below: Nanos)
fn retain_recent(&self, drop_below: Nanos)
Remove those keys with state older than
drop_below.Source§fn shrink_to_fit(&self)
fn shrink_to_fit(&self)
Shrinks the capacity of the state store, if possible. Read more