Trait ratelimit_meter::Decider
[−]
[src]
pub trait Decider { type T; fn test_and_update(&mut self, at: Instant) -> Decision<Self::T>; fn build_with(l: &Limiter) -> Result<Self>
where
Self: Sized; fn check(&mut self) -> Decision<Self::T> { ... } }
Associated Types
type T
The (optional) type for additional information on negative decisions.
Required Methods
fn test_and_update(&mut self, at: Instant) -> Decision<Self::T>
Tests if a single cell can be accomodated in the rate limiter
at the instant at
and updates the rate-limiter to account
for the weight of the cell.
fn build_with(l: &Limiter) -> Result<Self> where
Self: Sized,
Self: Sized,
Converts the limiter builder into a concrete decider structure.
Provided Methods
fn check(&mut self) -> Decision<Self::T>
Tests if a single cell can be accomodated now. See test_and_update
.