pub struct Limiter { /* private fields */ }Implementations§
Source§impl Limiter
impl Limiter
pub fn new(policy: Policy) -> Self
pub fn with_capacity(policy: Policy, capacity: usize) -> Self
Sourcepub fn attempt(&self, addr: IpAddr, now: Instant) -> Result<(), Duration>
pub fn attempt(&self, addr: IpAddr, now: Instant) -> Result<(), Duration>
Start an attempt from addr: Err(retry_after) while it (or the
shared overflow budget it falls back to) is locked out, else the
attempt is counted as a failure until succeeded.
Auto Trait Implementations§
impl !Freeze for Limiter
impl RefUnwindSafe for Limiter
impl Send for Limiter
impl Sync for Limiter
impl Unpin for Limiter
impl UnsafeUnpin for Limiter
impl UnwindSafe for Limiter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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