Trait ratelimit_meter::Decider
[−]
[src]
pub trait Decider: DeciderImpl { fn check(&mut self) -> Result<Decision<Self::T>> { ... } fn check_at(&mut self, at: Instant) -> Result<Decision<Self::T>> { ... } }
The main decision trait. It allows checking a single cell against the rate-limiter, either at the current time instant, or at a given instant in time, both destructively.
Provided Methods
fn check(&mut self) -> Result<Decision<Self::T>>
Tests if a single cell can be accommodated at
Instant::now()
. See check_at
.
fn check_at(&mut self, at: Instant) -> Result<Decision<Self::T>>
Tests is a single cell can be accommodated at the given time stamp.
Implementors
impl Decider for Allower
impl Decider for GCRA
impl Decider for LeakyBucket
impl<Impl> Decider for Threadsafe<Impl> where
Impl: Decider + Sized + Clone,