pub struct BackoffBuilder { /* private fields */ }Expand description
Builder for ExponentialBackoff
Provides a fluent API for constructing backoff iterators.
Implementations§
Source§impl BackoffBuilder
impl BackoffBuilder
Sourcepub fn initial_delay(self, delay: Duration) -> Self
pub fn initial_delay(self, delay: Duration) -> Self
Set initial delay duration
Sourcepub fn max_retries(self, retries: u32) -> Self
pub fn max_retries(self, retries: u32) -> Self
Set maximum number of retries (None = unlimited)
Sourcepub fn multiplier(self, multiplier: f64) -> Self
pub fn multiplier(self, multiplier: f64) -> Self
Set multiplier for exponential growth (default: 2.0)
Sourcepub fn with_jitter(self) -> Self
pub fn with_jitter(self) -> Self
Enable jitter (±30% randomization on each delay)
Sourcepub fn max_total_duration(self, duration: Duration) -> Self
pub fn max_total_duration(self, duration: Duration) -> Self
Set total duration limit for all retries combined
Sourcepub fn build(self) -> ExponentialBackoff ⓘ
pub fn build(self) -> ExponentialBackoff ⓘ
Build the ExponentialBackoff iterator
Trait Implementations§
Source§impl Clone for BackoffBuilder
impl Clone for BackoffBuilder
Source§fn clone(&self) -> BackoffBuilder
fn clone(&self) -> BackoffBuilder
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 BackoffBuilder
impl Debug for BackoffBuilder
Auto Trait Implementations§
impl Freeze for BackoffBuilder
impl RefUnwindSafe for BackoffBuilder
impl Send for BackoffBuilder
impl Sync for BackoffBuilder
impl Unpin for BackoffBuilder
impl UnsafeUnpin for BackoffBuilder
impl UnwindSafe for BackoffBuilder
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