Struct ratelimit_meter::Threadsafe [] [src]

pub struct Threadsafe<Impl> where
    Impl: Sized,
    Impl: Clone
{ /* fields omitted */ }

A wrapper that ensures operations in otherwise thread-unsafe rate-limiting decision algorithms are thread-safe. This is implemented by wrapping the actual Decider implementation in an atomically reference-counted mutex. It takes out a mutex whenever .test_and_update() is called.

Trait Implementations

impl<Impl: Clone> Clone for Threadsafe<Impl> where
    Impl: Sized,
    Impl: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Impl> DeciderImpl for Threadsafe<Impl> where
    Impl: Decider,
    Impl: Sized,
    Impl: Clone
[src]

The (optional) type for additional information on negative decisions. Read more

[src]

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. Read more

[src]

Converts the limiter builder into a concrete decider structure.

impl<Impl> Decider for Threadsafe<Impl> where
    Impl: Decider,
    Impl: Sized,
    Impl: Clone
[src]

[src]

Tests if a single cell can be accomodated at Instant::now(). See check_at. Read more

[src]

Tests is a single cell can be accomodated at the given time stamp. Read more