pub enum AcquireOutcome {
Granted,
Denied {
retry_at: DateTime<Utc>,
},
}Expand description
The result of attempting to consume one token from a RateLease. A pure
function of the lease’s state + now.
Variants§
Granted
A token was consumed — the budgeted effect MAY proceed.
Denied
The quota is exhausted. retry_at is the earliest instant a token will
be available again (the input to on_exhausted: defer’s reschedule).
Implementations§
Source§impl AcquireOutcome
impl AcquireOutcome
pub fn is_granted(&self) -> bool
Trait Implementations§
Source§impl Clone for AcquireOutcome
impl Clone for AcquireOutcome
Source§fn clone(&self) -> AcquireOutcome
fn clone(&self) -> AcquireOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AcquireOutcome
impl Debug for AcquireOutcome
Source§impl PartialEq for AcquireOutcome
impl PartialEq for AcquireOutcome
impl StructuralPartialEq for AcquireOutcome
Auto Trait Implementations§
impl Freeze for AcquireOutcome
impl RefUnwindSafe for AcquireOutcome
impl Send for AcquireOutcome
impl Sync for AcquireOutcome
impl Unpin for AcquireOutcome
impl UnsafeUnpin for AcquireOutcome
impl UnwindSafe for AcquireOutcome
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.