pub enum RateLimitError {
ExceedsCapacity,
ContentionFailure,
ExpiredTick,
}Expand description
Error types for rate limiter operations.
These errors indicate different failure modes when attempting to acquire tokens from a rate limiter.
Variants§
ExceedsCapacity
Request exceeds available capacity.
This indicates that allowing the request would violate the rate limit. The caller should either:
- Reject the request
- Wait and retry later
- Reduce the number of tokens requested
ContentionFailure
Failed due to contention with other threads.
This occurs when the internal lock cannot be acquired immediately. The caller should typically:
- Retry the operation
- Implement backoff strategy
- Consider the request as temporarily failed
ExpiredTick
The provided tick is too old or regressed.
This occurs when:
- Time appears to go backwards
- An older tick is reused
- System clock adjustments occur
Trait Implementations§
Source§impl Clone for RateLimitError
impl Clone for RateLimitError
Source§fn clone(&self) -> RateLimitError
fn clone(&self) -> RateLimitError
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RateLimitError
impl Debug for RateLimitError
Source§impl Display for RateLimitError
impl Display for RateLimitError
Source§impl Error for RateLimitError
impl Error for RateLimitError
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 RateLimitError
impl PartialEq for RateLimitError
impl Copy for RateLimitError
impl Eq for RateLimitError
impl StructuralPartialEq for RateLimitError
Auto Trait Implementations§
impl Freeze for RateLimitError
impl RefUnwindSafe for RateLimitError
impl Send for RateLimitError
impl Sync for RateLimitError
impl Unpin for RateLimitError
impl UnwindSafe for RateLimitError
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