pub struct ExponentialBackoff { /* private fields */ }Expand description
Exponential backoff with jitter.
Implementations§
Trait Implementations§
Source§impl Debug for ExponentialBackoff
impl Debug for ExponentialBackoff
Source§impl RecoveryStrategy for ExponentialBackoff
impl RecoveryStrategy for ExponentialBackoff
Source§fn should_retry(&self, error: &Error, attempt: u32) -> bool
fn should_retry(&self, error: &Error, attempt: u32) -> bool
Decide whether to retry after an error.
Source§fn backoff_duration(&self, attempt: u32) -> Duration
fn backoff_duration(&self, attempt: u32) -> Duration
Get delay before next retry.
Source§fn on_success(&self, _attempts: u32)
fn on_success(&self, _attempts: u32)
Called when recovery succeeds.
Source§fn on_give_up(&self, _error: &Error, _attempts: u32)
fn on_give_up(&self, _error: &Error, _attempts: u32)
Called when recovery is abandoned.
Auto Trait Implementations§
impl Freeze for ExponentialBackoff
impl RefUnwindSafe for ExponentialBackoff
impl Send for ExponentialBackoff
impl Sync for ExponentialBackoff
impl Unpin for ExponentialBackoff
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).