pub struct RetryConfig { /* private fields */ }Expand description
Controls how FyndClient::quote retries transient failures.
Retries use exponential back-off: each attempt doubles the delay, capped at
max_backoff. Only errors where
FyndError::is_retryable returns true are retried.
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn new(
max_attempts: u32,
initial_backoff: Duration,
max_backoff: Duration,
) -> Self
pub fn new( max_attempts: u32, initial_backoff: Duration, max_backoff: Duration, ) -> Self
Create a custom retry configuration.
max_attempts: total attempts including the first try.initial_backoff: sleep duration before the second attempt.max_backoff: upper bound on any single sleep duration.
Sourcepub fn max_attempts(&self) -> u32
pub fn max_attempts(&self) -> u32
Maximum number of total attempts (default: 3).
Sourcepub fn initial_backoff(&self) -> Duration
pub fn initial_backoff(&self) -> Duration
Sleep duration before the first retry (default: 100 ms).
Sourcepub fn max_backoff(&self) -> Duration
pub fn max_backoff(&self) -> Duration
Upper bound on any single sleep duration (default: 2 s).
Trait Implementations§
Source§impl Clone for RetryConfig
impl Clone for RetryConfig
Source§fn clone(&self) -> RetryConfig
fn clone(&self) -> RetryConfig
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 moreAuto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnsafeUnpin for RetryConfig
impl UnwindSafe for RetryConfig
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 more