pub struct ExponentialBackoff { /* private fields */ }
Implementations§
Source§impl ExponentialBackoff
impl ExponentialBackoff
pub fn new( initial_duration: Duration, max_duration: Duration, multiplier: f64, defer_duration: Duration, ) -> Self
Sourcepub fn defer_reset(&mut self)
pub fn defer_reset(&mut self)
Reset the backoff, but only if wait
is not called again for at least defer_duration
.
pub async fn wait(&mut self)
pub fn reset(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExponentialBackoff
impl RefUnwindSafe for ExponentialBackoff
impl Send for ExponentialBackoff
impl Sync for ExponentialBackoff
impl Unpin for ExponentialBackoff
impl UnwindSafe for ExponentialBackoff
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