[][src]Module governor::state::keyed

Keyed rate limiters (those that can hold one state per key).

These are rate limiters that have one set of parameters (burst capacity per time period) but apply those to several sets of actual rate-limiting states, e.g. to enforce one API call rate limit per API key.

Rate limiters based on these types are constructed with the RateLimiter constructors

Traits

KeyedStateStore

A trait for state stores with one rate limiting state per key.

ShrinkableKeyedStateStore

Keyed rate limiters that can be "cleaned up".

Type Definitions

DashMapStateStore

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

DefaultKeyedStateStore

The default keyed rate limiter type: the concurrent [DashMap][dashmap::DashMap].

HashMapStateStore

A thread-safe (but not very performant) implementation of a keyed rate limiter state store using HashMap.