pub struct RateLimitSection {
pub enabled: bool,
pub requests_per_second: f64,
pub burst_size: u32,
pub max_tracked_ips: usize,
pub trust_proxy: bool,
}Expand description
Per-IP rate limiting (token bucket).
Fields§
§enabled: boolEnable rate-limit middleware. Default: false (enable in Production appsettings).
requests_per_second: f64Sustained requests per second per client IP.
burst_size: u32Burst capacity before throttling.
max_tracked_ips: usizeMaximum distinct client IPs tracked (LRU eviction when exceeded).
trust_proxy: boolTrust X-Forwarded-For / X-Real-IP headers for client IP extraction. Only enable when behind a trusted reverse proxy. Default: false.
Trait Implementations§
Source§impl Clone for RateLimitSection
impl Clone for RateLimitSection
Source§fn clone(&self) -> RateLimitSection
fn clone(&self) -> RateLimitSection
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 RateLimitSection
impl Debug for RateLimitSection
Source§impl Default for RateLimitSection
impl Default for RateLimitSection
Source§fn default() -> RateLimitSection
fn default() -> RateLimitSection
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RateLimitSection
impl<'de> Deserialize<'de> for RateLimitSection
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RateLimitSection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RateLimitSection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimitSection
impl RefUnwindSafe for RateLimitSection
impl Send for RateLimitSection
impl Sync for RateLimitSection
impl Unpin for RateLimitSection
impl UnsafeUnpin for RateLimitSection
impl UnwindSafe for RateLimitSection
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