pub struct RateLimitExt {
pub key: String,
pub quota: Quota,
pub decision: Decision,
pub allowed: bool,
pub remaining: u64,
pub limit: u64,
pub reset_seconds: u64,
}Expand description
Rate limit information available via request extensions.
This is automatically added to requests when using the rate limit middleware.
Fields§
§key: StringThe key used for rate limiting this request.
quota: QuotaThe quota applied to this request.
decision: DecisionThe rate limit decision.
allowed: boolWhether the request was allowed.
remaining: u64Remaining requests in the current window.
limit: u64Maximum requests allowed.
reset_seconds: u64Seconds until reset.
Implementations§
Trait Implementations§
Source§impl Clone for RateLimitExt
impl Clone for RateLimitExt
Source§fn clone(&self) -> RateLimitExt
fn clone(&self) -> RateLimitExt
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 RateLimitExt
impl Debug for RateLimitExt
Source§impl From<&RateLimitExt> for RateLimitResponse
impl From<&RateLimitExt> for RateLimitResponse
Source§fn from(ext: &RateLimitExt) -> Self
fn from(ext: &RateLimitExt) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RateLimitExt
impl RefUnwindSafe for RateLimitExt
impl Send for RateLimitExt
impl Sync for RateLimitExt
impl Unpin for RateLimitExt
impl UnwindSafe for RateLimitExt
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