pub struct EffectiveQuota {
pub bucket: BucketId,
pub count: u32,
pub period: Duration,
/* private fields */
}Expand description
A quota a request is held to: one bucket, admitting count requests per
period and paced as WindowQuotaTable describes.
Fields§
§bucket: BucketIdThe bucket. Two quotas naming one bucket are one allowance.
count: u32The published count.
period: DurationThe published window.
Implementations§
Source§impl EffectiveQuota
impl EffectiveQuota
Sourcepub fn interval(&self) -> Duration
pub fn interval(&self) -> Duration
The interval the bucket paces requests at, read from the bucket itself.
Sourcepub fn admitted_in_one_window(&self) -> u128
pub fn admitted_in_one_window(&self) -> u128
Requests the bucket admits in the worst-case window of length
period: its whole depth at once, plus every token its refill adds by
the window’s end. A fresh bucket is the worst case, since buckets
start full.
Trait Implementations§
Source§impl Clone for EffectiveQuota
impl Clone for EffectiveQuota
impl Copy for EffectiveQuota
Source§impl Debug for EffectiveQuota
impl Debug for EffectiveQuota
impl Eq for EffectiveQuota
Source§impl PartialEq for EffectiveQuota
impl PartialEq for EffectiveQuota
impl StructuralPartialEq for EffectiveQuota
Auto Trait Implementations§
impl Freeze for EffectiveQuota
impl RefUnwindSafe for EffectiveQuota
impl Send for EffectiveQuota
impl Sync for EffectiveQuota
impl Unpin for EffectiveQuota
impl UnsafeUnpin for EffectiveQuota
impl UnwindSafe for EffectiveQuota
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