pub struct Limits {
pub max_attempts: u32,
pub window: Duration,
pub capacity: usize,
}Expand description
Throttle shape: how many attempts, over what window, across how many keys.
Fields§
§max_attempts: u32Attempts one key may make inside window before being refused.
window: DurationWidth of the sliding window, measured from each attempt.
capacity: usizeDistinct keys held at once. Bounding this is not an optimization: the key is derived from the peer, so an unbounded map is a memory DoS reachable by anyone who can open connections.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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