pub struct AdaptiveRateConfig {
pub base_rate_per_minute: u64,
pub burst_multiplier: f64,
pub anomaly_reduction_factor: f64,
pub recovery_period: Duration,
pub window_size: Duration,
}Expand description
Configuration for the adaptive rate limiter.
Fields§
§base_rate_per_minute: u64Base allowed requests per window. Default: 100.
burst_multiplier: f64Multiplier for burst threshold above current rate. Default: 2.0.
Requests above current_rate * burst_multiplier are denied.
anomaly_reduction_factor: f64Factor to reduce rate on anomaly detection. Default: 0.5 (halves rate). Clamped to [0.0, 1.0].
recovery_period: DurationHow long the reduced rate persists after anomaly. Default: 5 minutes.
window_size: DurationSize of the sliding window. Default: 1 minute.
Implementations§
Trait Implementations§
Source§impl Clone for AdaptiveRateConfig
impl Clone for AdaptiveRateConfig
Source§fn clone(&self) -> AdaptiveRateConfig
fn clone(&self) -> AdaptiveRateConfig
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 AdaptiveRateConfig
impl Debug for AdaptiveRateConfig
Auto Trait Implementations§
impl Freeze for AdaptiveRateConfig
impl RefUnwindSafe for AdaptiveRateConfig
impl Send for AdaptiveRateConfig
impl Sync for AdaptiveRateConfig
impl Unpin for AdaptiveRateConfig
impl UnsafeUnpin for AdaptiveRateConfig
impl UnwindSafe for AdaptiveRateConfig
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