Struct governor::middleware::NoOpMiddleware [−][src]
pub struct NoOpMiddleware<P: Reference = <DefaultClock as Clock>::Instant> { /* fields omitted */ }
Expand description
A middleware that does nothing and returns ()
in the positive outcome.
Trait Implementations
type PositiveOutcome = ()
type PositiveOutcome = ()
By default, rate limiters return nothing other than an indicator that the element should be let through.
Returns ()
and has no side-effects.
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
Returns the error indicating what
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