pub struct RateLimitConfig {
pub global_per_min: u32,
pub per_ip_per_min: u32,
pub per_key_per_min: u32,
pub global_burst: u32,
pub per_ip_burst: u32,
pub per_key_burst: u32,
pub burst_size: u32,
pub ip_table_size: usize,
}Fields§
§global_per_min: u32§per_ip_per_min: u32§per_key_per_min: u32Default per-key rate. Overridden by ApiKeyConfig.rate_limit_per_min.
global_burst: u32§per_ip_burst: u32§per_key_burst: u32Default per-key burst. Overridden by ApiKeyConfig.burst when > 0.
burst_size: u32Legacy field — sets all three burst values if the per-tier fields are absent.
Deprecated; use global_burst, per_ip_burst, per_key_burst instead.
ip_table_size: usizeMaximum entries in the per-IP bucket map; LRU eviction above this. 0 = unlimited (not recommended in production).
Implementations§
Source§impl RateLimitConfig
impl RateLimitConfig
Sourcepub fn effective_global_burst(&self) -> u32
pub fn effective_global_burst(&self) -> u32
Effective global burst: per-tier value if set, else legacy burst_size, else default.
pub fn effective_per_ip_burst(&self) -> u32
pub fn effective_per_key_burst(&self) -> u32
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§fn clone(&self) -> RateLimitConfig
fn clone(&self) -> RateLimitConfig
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 RateLimitConfig
impl Debug for RateLimitConfig
Source§impl Default for RateLimitConfig
impl Default for RateLimitConfig
Source§impl<'de> Deserialize<'de> for RateLimitConfig
impl<'de> Deserialize<'de> for RateLimitConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RateLimitConfig
impl RefUnwindSafe for RateLimitConfig
impl Send for RateLimitConfig
impl Sync for RateLimitConfig
impl Unpin for RateLimitConfig
impl UnsafeUnpin for RateLimitConfig
impl UnwindSafe for RateLimitConfig
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