pub enum Acquire {
Ok,
Retry(Duration),
Unattainable {
burst_capacity: u64,
},
}Expand description
Outcome of RateLimiter::try_acquire_with_retry: a permit was granted, or
the caller should wait at least Retry(d) before a retry will conform - the
value for an HTTP Retry-After. Under contention the duration is a
best-effort hint (another thread may take the slot first), the guarantee
every lock-free rate limiter’s retry-after carries.
Unattainable is the typed answer to a request no amount of waiting can
satisfy: n above burst_capacity overshoots the burst window even from a
fully idle limiter, so it is a sizing error rather than backpressure.
governor reports the same condition as InsufficientCapacity.
Variants§
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