Trait ratelimit_meter::MultiDecider
[−]
[src]
pub trait MultiDecider: MultiDeciderImpl { fn check_n_at(&mut self, n: u32, at: Instant) -> Result<Decision<Self::T>> { ... } fn check_n(&mut self, n: u32) -> Result<Decision<Self::T>> { ... } }
Provided Methods
fn check_n_at(&mut self, n: u32, at: Instant) -> Result<Decision<Self::T>>
Tests if n
cells can be accommodated at the given time
stamp. An error ErrorKind::InsufficientCapacity
is
returned if n
exceeds the bucket capacity.
fn check_n(&mut self, n: u32) -> Result<Decision<Self::T>>
Tests if n
cells can be accommodated at the current time
(Instant::now()
). An error
ErrorKind::InsufficientCapacity
is returned if n
exceeds the bucket capacity.
Implementors
impl MultiDecider for Allower
impl MultiDecider for GCRA
impl MultiDecider for LeakyBucket