pub enum ThrottleError {
RequestExceedsCapacity {
requested: u64,
capacity: u64,
},
ZeroRefillExhausted {
requested: u64,
available: u64,
},
}Expand description
Errors returned by Throttle::acquire_blocking.
Variants§
RequestExceedsCapacity
The caller asked for more tokens than the bucket can ever hold. Waiting would deadlock; the request must be rejected at the source.
ZeroRefillExhausted
The bucket has a zero refill rate and the initial capacity is insufficient for the request. There is no way to ever satisfy the request, so blocking is pointless.
Trait Implementations§
Source§impl Debug for ThrottleError
impl Debug for ThrottleError
Source§impl Display for ThrottleError
impl Display for ThrottleError
Source§impl Error for ThrottleError
impl Error for ThrottleError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ThrottleError
impl PartialEq for ThrottleError
Source§fn eq(&self, other: &ThrottleError) -> bool
fn eq(&self, other: &ThrottleError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ThrottleError
impl StructuralPartialEq for ThrottleError
Auto Trait Implementations§
impl Freeze for ThrottleError
impl RefUnwindSafe for ThrottleError
impl Send for ThrottleError
impl Sync for ThrottleError
impl Unpin for ThrottleError
impl UnsafeUnpin for ThrottleError
impl UnwindSafe for ThrottleError
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<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§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.