Type Alias governor::state::keyed::HashMapStateStore
source · pub type HashMapStateStore<K> = Mutex<HashMap<K, InMemoryState>>;
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§
struct HashMapStateStore<K> { /* private fields */ }
Trait Implementations§
source§impl<K: Hash + Eq + Clone> ShrinkableKeyedStateStore<K> for HashMapStateStore<K>
impl<K: Hash + Eq + Clone> ShrinkableKeyedStateStore<K> for HashMapStateStore<K>
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