pub struct FailLimiter { /* private fields */ }Expand description
The limiter. One instance per host, shared by its connection threads behind a lock.
Implementations§
Source§impl FailLimiter
impl FailLimiter
pub fn new() -> Self
Sourcepub fn refuses_unverified(&self, conn: u64, now: Instant) -> bool
pub fn refuses_unverified(&self, conn: u64, now: Instant) -> bool
True when a secret that did not verify from conn must be refused at now: this
connection is blocked, or all callers together are. Call this only for an attempt whose
secret failed to verify; never for one that verified.
Sourcepub fn record_failure(&mut self, conn: u64, now: Instant)
pub fn record_failure(&mut self, conn: u64, now: Instant)
Record one failed authentication (a secret that did not verify) from conn.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FailLimiter
impl RefUnwindSafe for FailLimiter
impl Send for FailLimiter
impl Sync for FailLimiter
impl Unpin for FailLimiter
impl UnsafeUnpin for FailLimiter
impl UnwindSafe for FailLimiter
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