pub type DashMapStateStore<K> = DashMap<K, InMemoryState>;
Expand description

A concurrent, thread-safe and fairly performant hashmap based on DashMap.

Aliased Type§

struct DashMapStateStore<K> { /* private fields */ }

Trait Implementations§

source§

impl<K: Hash + Eq + Clone> ShrinkableKeyedStateStore<K> for DashMapStateStore<K>

source§

fn retain_recent(&self, drop_below: Nanos)

Remove those keys with state older than drop_below.
source§

fn shrink_to_fit(&self)

Shrinks the capacity of the state store, if possible. Read more
source§

fn len(&self) -> usize

Returns the number of “live” keys stored in the state store. Read more
source§

fn is_empty(&self) -> bool

Returns true if self has no keys stored in it. Read more
source§

impl<K: Hash + Eq + Clone> StateStore for DashMapStateStore<K>

§

type Key = K

The type of key that the state store can represent.
source§

fn measure_and_replace<T, F, E>(&self, key: &Self::Key, f: F) -> Result<T, E>
where F: Fn(Option<Nanos>) -> Result<(T, Nanos), E>,

Updates a state store’s rate limiting state for a given key, using the given closure. Read more