pub struct RateLimitConfig {
pub capacity: u32,
pub refill_per_sec: u32,
}Expand description
Token-bucket parameters. Deploy-time knobs, uniform with the rest of the edge
config (see crate::EdgeConfig).
Fields§
§capacity: u32Bucket capacity — the maximum burst of ops admitted back-to-back. 0
disables rate limiting (every op is admitted).
refill_per_sec: u32Tokens refilled per second (the sustained op rate once the burst is spent).
Implementations§
Source§impl RateLimitConfig
impl RateLimitConfig
Sourcepub fn disabled(&self) -> bool
pub fn disabled(&self) -> bool
Whether limiting is off (capacity 0), in which case RateLimiters::allow
never rejects and never allocates a bucket.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
impl Copy for RateLimitConfig
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