pub struct TokenBucketState { /* private fields */ }
Expand description
All required state that can be shared among many TokenBucketRateLimiters
TokenBucketRateLimiter
s take Arc<Mutex<TokenBucketState>>
so a single state (including the replenishment task)
can be shared among many rate limiters, e.g. when a single API has multiple endpoints, each requiring different costs
but counting against the same user rate limit.
Implementations§
Trait Implementations§
Source§impl Debug for TokenBucketState
impl Debug for TokenBucketState
Auto Trait Implementations§
impl Freeze for TokenBucketState
impl !RefUnwindSafe for TokenBucketState
impl Send for TokenBucketState
impl Sync for TokenBucketState
impl Unpin for TokenBucketState
impl !UnwindSafe for TokenBucketState
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