pub enum RateLimitError {
Storage(StorageError),
Config(ConfigError),
KeyExtraction(String),
Connection(ConnectionError),
Internal(String),
RateLimitExceeded {
retry_after: Option<Duration>,
remaining: u64,
limit: u64,
},
}Expand description
Main error type for rate limiting operations.
Variants§
Storage(StorageError)
Storage backend error.
Config(ConfigError)
Configuration error.
KeyExtraction(String)
Key extraction error.
Connection(ConnectionError)
Connection error (e.g., Redis connection failed).
Internal(String)
Internal error.
RateLimitExceeded
Rate limit exceeded with retry information.
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<ConfigError> for RateLimitError
impl From<ConfigError> for RateLimitError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<ConnectionError> for RateLimitError
impl From<ConnectionError> for RateLimitError
Source§fn from(source: ConnectionError) -> Self
fn from(source: ConnectionError) -> Self
Converts to this type from the input type.
Source§impl From<StorageError> for RateLimitError
impl From<StorageError> for RateLimitError
Source§fn from(source: StorageError) -> Self
fn from(source: StorageError) -> 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 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