pub enum LimitRejection<K, Q = Infallible> {
KeyExtractionFailure(K),
QuotaResolutionFailure(Q),
RateLimitExceeded(RateLimitSnapshot),
Backend(String),
}Expand description
Enumerates possible failure modes for rate limiting when extracting from request parts.
Variants§
KeyExtractionFailure(K)
Indicates a failure during key extraction, storing the underlying rejection reason.
QuotaResolutionFailure(Q)
Indicates that quota resolution failed.
RateLimitExceeded(RateLimitSnapshot)
Indicates that the rate limit has been exceeded.
Backend(String)
Indicates that the storage backend failed while checking the limit.
Trait Implementations§
Source§impl<K: Error + 'static, Q: Error + 'static> Error for LimitRejection<K, Q>
impl<K: Error + 'static, Q: Error + 'static> Error for LimitRejection<K, Q>
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<K: IntoResponse, Q: IntoResponse> IntoResponse for LimitRejection<K, Q>
impl<K: IntoResponse, Q: IntoResponse> IntoResponse for LimitRejection<K, Q>
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl<K, Q> Freeze for LimitRejection<K, Q>
impl<K, Q> RefUnwindSafe for LimitRejection<K, Q>where
K: RefUnwindSafe,
Q: RefUnwindSafe,
impl<K, Q> Send for LimitRejection<K, Q>
impl<K, Q> Sync for LimitRejection<K, Q>
impl<K, Q> Unpin for LimitRejection<K, Q>
impl<K, Q> UnsafeUnpin for LimitRejection<K, Q>where
K: UnsafeUnpin,
Q: UnsafeUnpin,
impl<K, Q> UnwindSafe for LimitRejection<K, Q>where
K: UnwindSafe,
Q: UnwindSafe,
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