#[non_exhaustive]pub enum RateLimitError {
Unexpected(Box<dyn Error>),
MaxHops,
Serialization(Error),
}Expand description
Errors that can occur during rate limiting operations.
This enum represents all possible error conditions that can arise when performing rate limit checks or managing rate limit state.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unexpected(Box<dyn Error>)
An unexpected error occurred during rate limiting operations.
This wraps any underlying errors from storage operations or other unexpected conditions.
MaxHops
The maximum allowed number of hops was reached in distributed rate limiting.
This error occurs when the distributed rate limiting algorithm has reached its maximum number of outgoing requests while trying to find available quota.
Serialization(Error)
A serialization error occurred.
This error occurs when there is an error serializing or deserializing data.
Trait Implementations§
Source§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
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 From<DistributedStorageError> for RateLimitError
impl From<DistributedStorageError> for RateLimitError
Source§fn from(value: DistributedStorageError) -> Self
fn from(value: DistributedStorageError) -> Self
Converts to this type from the input type.
Source§impl From<LocalStorageError> for RateLimitError
impl From<LocalStorageError> for RateLimitError
Source§fn from(value: LocalStorageError) -> Self
fn from(value: LocalStorageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RateLimitError
impl !RefUnwindSafe for RateLimitError
impl !Send for RateLimitError
impl !Sync for RateLimitError
impl Unpin for RateLimitError
impl UnsafeUnpin 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