pub struct BackoffState { /* private fields */ }Expand description
Stateful backoff tracker. Call next_delay() after each
failed attempt and reset() after success.
Implementations§
Source§impl BackoffState
impl BackoffState
pub fn new(config: BackoffConfig) -> Self
pub fn next_delay(&mut self) -> Duration
pub fn reset(&mut self)
pub fn current_delay(&self) -> Duration
Trait Implementations§
Source§impl Clone for BackoffState
impl Clone for BackoffState
Source§fn clone(&self) -> BackoffState
fn clone(&self) -> BackoffState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BackoffState
impl RefUnwindSafe for BackoffState
impl Send for BackoffState
impl Sync for BackoffState
impl Unpin for BackoffState
impl UnsafeUnpin for BackoffState
impl UnwindSafe for BackoffState
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