pub enum RateLimitError {
InsufficientCapacity {
acquiring: Uint,
available: Uint,
retry_after: Duration,
},
BeyondCapacity {
acquiring: Uint,
capacity: Uint,
},
ExpiredTick {
min_acceptable_tick: Uint,
},
ContentionFailure,
}Expand description
Verbose error type with detailed diagnostic information and Duration-based retry timing.
This error type provides comprehensive information about rate limiting failures, including current state and retry timing information. The retry timing is provided as a standard Duration for easy integration with async ecosystems.
Variants§
InsufficientCapacity
Not enough tokens available to fulfill the request.
Fields
BeyondCapacity
The requested number of tokens exceeds the maximum capacity.
Fields
ExpiredTick
The provided tick is older than the acceptable minimum.
ContentionFailure
Failed to acquire the internal lock due to contention.
Implementations§
Source§impl RateLimitError
impl RateLimitError
Sourcepub fn from_core_error<F>(
error: VerboseRateLimitError,
tick_to_duration: F,
) -> Self
pub fn from_core_error<F>( error: VerboseRateLimitError, tick_to_duration: F, ) -> Self
Creates a RateLimitError from a core verbose error.
This method converts core verbose errors to high-level errors, with tick-to-Duration conversion using the provided converter function.
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§fn clone_from(&mut self, source: &Self)
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 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