pub struct Exhausted {
pub used: u64,
pub limit: u64,
pub period_end: OffsetDateTime,
pub retry_after: Duration,
}Expand description
A refused consume: the allowance could not carry the
amount, so nothing was counted and no work may proceed. An amount larger
than the whole allowance is refused as exhausted from the start — on an
empty meter, used is 0.
Fields§
§used: u64The total already spent in this period.
limit: u64The allowance that is spent.
period_end: OffsetDateTimeWhen the period ends and the allowance resets.
retry_after: DurationThe pause from the instant of the call to period_end, what
crate::allowance_exhausted reports as Retry-After.
Implementations§
Source§impl Exhausted
impl Exhausted
Sourcepub fn spent(used: u64, limit: u64, period: Period, now: OffsetDateTime) -> Self
pub fn spent(used: u64, limit: u64, period: Period, now: OffsetDateTime) -> Self
The refusal for a caller that found the allowance spent by reading
the meter back — the batch shape’s route to the 429, since
consume_statement fails rather than
affecting zero rows. now is the instant of the call.
Trait Implementations§
impl Copy for Exhausted
impl Eq for Exhausted
impl StructuralPartialEq for Exhausted
Auto Trait Implementations§
impl Freeze for Exhausted
impl RefUnwindSafe for Exhausted
impl Send for Exhausted
impl Sync for Exhausted
impl Unpin for Exhausted
impl UnsafeUnpin for Exhausted
impl UnwindSafe for Exhausted
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.