pub enum Acquire {
Granted,
RetryAt(u64),
Never,
}Expand description
The result of TokenBucket::try_acquire (and
RateLimiter::try_acquire).
Variants§
Granted
The requested units were spent; the caller may proceed.
RetryAt(u64)
Not enough budget: the earliest monotonic instant (in the caller’s clock, nanoseconds) at which the requested units can be granted.
Never
The request exceeds the burst capacity and can never be granted
as a single acquisition. Split it up (e.g. in burst-sized chunks,
as RateLimiter::acquire does) or reject it.
Trait Implementations§
impl Copy for Acquire
impl Eq for Acquire
impl StructuralPartialEq for Acquire
Auto Trait Implementations§
impl Freeze for Acquire
impl RefUnwindSafe for Acquire
impl Send for Acquire
impl Sync for Acquire
impl Unpin for Acquire
impl UnsafeUnpin for Acquire
impl UnwindSafe for Acquire
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