pub struct RateLimitResult {
pub allowed: bool,
pub current_attempts: u32,
pub max_attempts: u32,
pub remaining_attempts: u32,
pub reset_at: i64,
pub penalty_expires_at: Option<i64>,
}Expand description
Rate limit check result
Fields§
§allowed: boolWhether the request is allowed
current_attempts: u32Current attempt count in the window
max_attempts: u32Maximum attempts allowed
remaining_attempts: u32Remaining attempts before hitting the limit
reset_at: i64Unix timestamp when the rate limit window resets
penalty_expires_at: Option<i64>Optional: Unix timestamp when penalty expires (if in penalty period)
Implementations§
Trait Implementations§
Source§impl Clone for RateLimitResult
impl Clone for RateLimitResult
Source§fn clone(&self) -> RateLimitResult
fn clone(&self) -> RateLimitResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RateLimitResult
impl Debug for RateLimitResult
Source§impl<'de> Deserialize<'de> for RateLimitResult
impl<'de> Deserialize<'de> for RateLimitResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimitResult
impl RefUnwindSafe for RateLimitResult
impl Send for RateLimitResult
impl Sync for RateLimitResult
impl Unpin for RateLimitResult
impl UnsafeUnpin for RateLimitResult
impl UnwindSafe for RateLimitResult
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