pub struct ExponentialBackoff { /* private fields */ }Expand description
Exponential backoff: delay doubles with each attempt, capped at a maximum.
The delay for attempt N is min(base * 2^(N-1), max).
Implementations§
Source§impl ExponentialBackoff
impl ExponentialBackoff
Sourcepub fn new(base: Duration, max: Duration) -> Result<Self, BackoffConfigError>
pub fn new(base: Duration, max: Duration) -> Result<Self, BackoffConfigError>
Creates a new exponential backoff strategy.
§Errors
Returns BackoffConfigError::BaseExceedsMax if base exceeds max.
Trait Implementations§
Source§impl BackoffStrategy for ExponentialBackoff
impl BackoffStrategy for ExponentialBackoff
Source§impl Clone for ExponentialBackoff
impl Clone for ExponentialBackoff
Source§fn clone(&self) -> ExponentialBackoff
fn clone(&self) -> ExponentialBackoff
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExponentialBackoff
impl Debug for ExponentialBackoff
Source§impl PartialEq for ExponentialBackoff
impl PartialEq for ExponentialBackoff
impl Copy for ExponentialBackoff
impl Eq for ExponentialBackoff
impl StructuralPartialEq for ExponentialBackoff
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