pub struct RateLimit {
pub interval: Duration,
pub initial: usize,
pub max: usize,
pub refill: usize,
}Expand description
Rate limiter config
Fields§
§interval: DurationThe time duration between which we add refill number to the bucket
initial: usizeThe initial number of tokens
max: usizeThe max number of tokens to use
refill: usizeThe number of tokens to add at each interval interval
Trait Implementations§
Source§impl From<RateLimit> for RateLimiter
impl From<RateLimit> for RateLimiter
impl Copy for RateLimit
Auto Trait Implementations§
impl Freeze for RateLimit
impl RefUnwindSafe for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnwindSafe for RateLimit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more