pub struct RateLimitState {
pub failed_attempts: u32,
pub window_start: DateTime<Utc>,
pub blocked_until: Option<DateTime<Utc>>,
pub successful_requests: u32,
pub success_window_start: DateTime<Utc>,
}
Expand description
Rate limiting state for failed authentication attempts
Fields§
§failed_attempts: u32
Number of failed attempts
window_start: DateTime<Utc>
When the first attempt in the current window occurred
blocked_until: Option<DateTime<Utc>>
When the client is blocked until (if any)
successful_requests: u32
Number of successful requests in current window (for role-based limiting)
success_window_start: DateTime<Utc>
When the success tracking window started
Trait Implementations§
Source§impl Clone for RateLimitState
impl Clone for RateLimitState
Source§fn clone(&self) -> RateLimitState
fn clone(&self) -> RateLimitState
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 moreAuto Trait Implementations§
impl Freeze for RateLimitState
impl RefUnwindSafe for RateLimitState
impl Send for RateLimitState
impl Sync for RateLimitState
impl Unpin for RateLimitState
impl UnwindSafe for RateLimitState
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