pub trait VariableCostRateLimiter {
    // Required method
    fn wait_with_cost(&mut self, cost: usize) -> impl Future<Output = ()> + Send;
}
Expand description

A cost-based rate limiter, where each call can be of a variable cost.

Calls that cost more than all potentially available permits WILL deadlock permanently.

See TokenBucketRateLimiter for a common use case.

Required Methods§

source

fn wait_with_cost(&mut self, cost: usize) -> impl Future<Output = ()> + Send

Object Safety§

This trait is not object safe.

Implementors§