AsTokens

Trait AsTokens 

Source
pub trait AsTokens {
    // Required methods
    fn capacity(&self) -> usize;
    fn rate(&self) -> f64;
}
Expand description

Any type that can be assigned a number of rate-limit tokens.

Required Methods§

Source

fn capacity(&self) -> usize

Get the token capacity for this object.

Source

fn rate(&self) -> f64

Get the refill rate for this object. A rate of 1.0 means one token per second.

Implementations on Foreign Types§

Source§

impl AsTokens for RateLimit

Source§

fn rate(&self) -> f64

Source§

fn capacity(&self) -> usize

Implementors§