pub struct RetryConfig {
pub initial_delay: Duration,
pub max_delay: Duration,
pub max_retries: usize,
pub backoff_multiplier: f64,
}Expand description
Default retry configuration for network operations
Fields§
§initial_delay: DurationInitial delay before first retry (default: 100ms)
max_delay: DurationMaximum delay between retries (default: 60 seconds)
max_retries: usizeMaximum number of retry attempts (default: 10)
backoff_multiplier: f64Backoff multiplier (default: 2.0 for exponential)
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn build_strategy(&self) -> impl Iterator<Item = Duration>
pub fn build_strategy(&self) -> impl Iterator<Item = Duration>
Build tokio-retry strategy from config
With tokio-retry, the iterator produces delays between attempts. N delays = N+1 total attempts (initial + N retries). So for max_retries total attempts, we need (max_retries - 1) delays.
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 moreSource§impl Debug for RetryConfig
impl Debug for RetryConfig
Auto Trait Implementations§
impl Freeze for RetryConfig
impl RefUnwindSafe for RetryConfig
impl Send for RetryConfig
impl Sync for RetryConfig
impl Unpin for RetryConfig
impl UnwindSafe for RetryConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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