[][src]Struct ratelimit_meter::example_algorithms::Allower

pub struct Allower {}

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

Example

use ratelimit_meter::DirectRateLimiter;
use ratelimit_meter::example_algorithms::Allower;
let mut allower = Allower::ratelimiter();
assert!(allower.check().is_ok());

Methods

impl Allower
[src]

Return a rate-limiter that lies, i.e. that allows all requests through.

Trait Implementations

impl Algorithm for Allower
[src]

The state of a single rate limiting bucket. Read more

The type returned when a rate limiting decision for a single cell is negative. Each rate limiting algorithm can decide to return the type that suits it best, but most algorithms' decisions also implement NonConformance, to ease handling of how long to wait. Read more

Constructs a rate limiter with the given parameters: capacity is the number of cells to allow, weighing cell_weight, every per_time_unit. Read more

Allows all cells through unconditionally.

Tests if a single cell can be accommodated in the rate limiter at the instant at and updates the rate-limiter state to account for the weight of the cell. Read more

impl RateLimitState<Allower> for ()
[src]

Returns the last time instant that the state had any relevance (i.e. the rate limiter would behave exactly as if it was a new rate limiter after this time). Read more

impl Copy for Allower
[src]

impl Clone for Allower
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Allower
[src]

Returns the "default value" for a type. Read more

impl Debug for Allower
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Allower

impl Sync for Allower

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Erased for T