Struct governor::middleware::StateInformationMiddleware [−][src]
pub struct StateInformationMiddleware;
Expand description
Middleware that returns the state of the rate limiter if a positive decision is reached.
Trait Implementations
type PositiveOutcome = StateSnapshot
type PositiveOutcome = StateSnapshot
The state snapshot returned from the limiter.
type NegativeOutcome = NotUntil<P>
type NegativeOutcome = NotUntil<P>
The type that’s returned by the rate limiter when a cell is not allowed. Read more
Called when a positive rate-limiting decision is made. Read more
fn disallow<K>(
_key: &K,
state: impl Into<StateSnapshot>,
start_time: P
) -> Self::NegativeOutcome
fn disallow<K>(
_key: &K,
state: impl Into<StateSnapshot>,
start_time: P
) -> Self::NegativeOutcome
Called when a negative rate-limiting decision is made (the “not allowed but OK” case). Read more