async_rate_limit::limiters

Trait ThreadsafeRateLimiter

Source
pub trait ThreadsafeRateLimiter {
    // Required method
    fn wait_until_ready(&self) -> impl Future<Output = ()> + Send;
}
Expand description

A threadsafe per-call rate limiter, where each call has an implied cost of 1 permit.

See SlidingWindowRateLimiter for a common use case.

Required Methods§

Source

fn wait_until_ready(&self) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§