Struct governor::state::InMemoryState[][src]

pub struct InMemoryState(_);
Expand description

An in-memory representation of a GCRA’s rate-limiting state.

Implemented using AtomicU64 operations, this state representation can be used to construct rate limiting states for other in-memory states: e.g., this crate uses InMemoryState as the states it tracks in the keyed rate limiters it implements.

Internally, the number tracked here is the theoretical arrival time (a GCRA term) in number of nanoseconds since the rate limiter was created.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The InMemoryState is the canonical “direct” state store.

The type of key that the state store can represent.

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.