pub struct ExponentialBackoff { /* private fields */ }Expand description
Exponential backoff with configurable multiplier.
Implementations§
Source§impl ExponentialBackoff
impl ExponentialBackoff
Sourcepub fn new(initial_interval: Duration) -> Self
pub fn new(initial_interval: Duration) -> Self
Creates a new exponential backoff with default multiplier of 2.0.
Sourcepub fn multiplier(self, multiplier: f64) -> Self
pub fn multiplier(self, multiplier: f64) -> Self
Sets the multiplier for exponential growth.
Sourcepub fn max_interval(self, max_interval: Duration) -> Self
pub fn max_interval(self, max_interval: Duration) -> Self
Sets the maximum interval to cap exponential growth.
Trait Implementations§
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 (const: unstable) · 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
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