pub struct ExponentialBackoffBuilder { /* private fields */ }Expand description
Builder for ExponentialBackoff.
Implementations§
Source§impl ExponentialBackoffBuilder
impl ExponentialBackoffBuilder
Sourcepub fn max_attempts(self, max_attempts: u32) -> Self
pub fn max_attempts(self, max_attempts: u32) -> Self
Sets the maximum number of retry attempts.
Sourcepub fn base_delay(self, base_delay: Duration) -> Self
pub fn base_delay(self, base_delay: Duration) -> Self
Sets the initial delay before the first retry.
Sourcepub fn multiplier(self, multiplier: f64) -> Self
pub fn multiplier(self, multiplier: f64) -> Self
Sets the multiplier for exponential growth (default: 2.0).
Sourcepub fn jitter(self, jitter: JitterStrategy) -> Self
pub fn jitter(self, jitter: JitterStrategy) -> Self
Sets the jitter strategy for retry delays.
Sourcepub fn build(self) -> ExponentialBackoff
pub fn build(self) -> ExponentialBackoff
Builds the exponential backoff strategy.
Trait Implementations§
Source§impl Clone for ExponentialBackoffBuilder
impl Clone for ExponentialBackoffBuilder
Source§fn clone(&self) -> ExponentialBackoffBuilder
fn clone(&self) -> ExponentialBackoffBuilder
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 ExponentialBackoffBuilder
impl Debug for ExponentialBackoffBuilder
Auto Trait Implementations§
impl Freeze for ExponentialBackoffBuilder
impl RefUnwindSafe for ExponentialBackoffBuilder
impl Send for ExponentialBackoffBuilder
impl Sync for ExponentialBackoffBuilder
impl Unpin for ExponentialBackoffBuilder
impl UnsafeUnpin for ExponentialBackoffBuilder
impl UnwindSafe for ExponentialBackoffBuilder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.