pub struct RateState {
pub current_rate: u64,
pub request_count: u64,
pub window_start: Instant,
pub anomaly_detected: bool,
pub anomaly_expires: Option<Instant>,
pub total_requests: u64,
pub total_denied: u64,
}Expand description
Per-entity rate state.
Fields§
§current_rate: u64Current allowed rate per window.
request_count: u64Requests counted in the current window.
window_start: InstantStart of the current window.
anomaly_detected: boolWhether an anomaly is currently active.
anomaly_expires: Option<Instant>When the anomaly penalty expires.
total_requests: u64Lifetime total requests for this entity.
total_denied: u64Lifetime total denied requests for this entity.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RateState
impl RefUnwindSafe for RateState
impl Send for RateState
impl Sync for RateState
impl Unpin for RateState
impl UnsafeUnpin for RateState
impl UnwindSafe for RateState
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