pub struct RateConfig {
pub requests_per_second: f64,
pub burst_capacity: f64,
pub warn_after: u32,
pub throttle_after: u32,
pub block_after: u32,
pub ban_after: u32,
pub ban_duration_secs: u64,
pub violation_decay_secs: u64,
}Fields§
§requests_per_second: f64Maximum requests per second per IP. Default: 50.
burst_capacity: f64Burst allowance (token bucket capacity). Default: 100.
warn_after: u32Number of violations before escalating to warn. Default: 3.
throttle_after: u32Number of violations before throttling. Default: 8.
block_after: u32Number of violations before blocking. Default: 15.
ban_after: u32Number of violations before temporary ban. Default: 30.
ban_duration_secs: u64Ban duration in seconds. Default: 300 (5 minutes).
violation_decay_secs: u64Violation decay period in seconds. Default: 60.
Trait Implementations§
Source§impl Clone for RateConfig
impl Clone for RateConfig
Source§fn clone(&self) -> RateConfig
fn clone(&self) -> RateConfig
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 RateConfig
impl Debug for RateConfig
Auto Trait Implementations§
impl Freeze for RateConfig
impl RefUnwindSafe for RateConfig
impl Send for RateConfig
impl Sync for RateConfig
impl Unpin for RateConfig
impl UnsafeUnpin for RateConfig
impl UnwindSafe for RateConfig
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