pub struct Allower {}
Expand description

The most naive implementation of a rate-limiter ever: Always allows every cell through.

Example

use ratelimit_meter::{Decider};
use ratelimit_meter::example_algorithms::Allower;
let mut allower = Allower::new();
assert!(allower.check().is_ok());

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Tests if a single cell can be accommodated at Instant::now(). If it can be, check updates the Decider to account for the conforming cell and returns Ok(()). Read more
Tests whether a single cell can be accommodated at the given time stamp. See check. Read more
Returns the “default value” for a type. Read more
Tests if n cells can be accommodated at the given time stamp. If (and only if) all cells in the batch can be accomodated, the MultiDecider updates the internal state to account for all cells and returns Ok(()). Read more
Tests if n cells can be accommodated at the current time (Instant::now()), using check_n_at Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.