pub struct RateLimitScopeConfig {
pub enabled: bool,
pub requests_per_period: u64,
pub period: Duration,
pub burst: u64,
}Expand description
Configuration for one token-bucket rate-limit scope.
Fields§
§enabled: boolWhether this scope is evaluated.
requests_per_period: u64Tokens refilled during each period.
period: DurationRefill period, in integer seconds on input.
burst: u64Extra tokens available above the steady-period request count.
Trait Implementations§
Source§impl Clone for RateLimitScopeConfig
impl Clone for RateLimitScopeConfig
Source§impl Debug for RateLimitScopeConfig
impl Debug for RateLimitScopeConfig
Source§impl Default for RateLimitScopeConfig
impl Default for RateLimitScopeConfig
Source§impl<'de> Deserialize<'de> for RateLimitScopeConfigwhere
RateLimitScopeConfig: Default,
impl<'de> Deserialize<'de> for RateLimitScopeConfigwhere
RateLimitScopeConfig: Default,
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 RateLimitScopeConfig
impl RefUnwindSafe for RateLimitScopeConfig
impl Send for RateLimitScopeConfig
impl Sync for RateLimitScopeConfig
impl Unpin for RateLimitScopeConfig
impl UnsafeUnpin for RateLimitScopeConfig
impl UnwindSafe for RateLimitScopeConfig
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