pub struct RetryConfig {
pub max_attempts: u32,
pub base_delay_ms: u64,
pub max_elapsed_time: Duration,
pub jitter_ms: u64,
pub backoff_multiplier: f64,
pub log_attempts: bool,
}Expand description
Configuration for retry behavior
Fields§
§max_attempts: u32Maximum number of retry attempts
base_delay_ms: u64Base delay in milliseconds before first retry
max_elapsed_time: DurationMaximum total elapsed time for all retry attempts
jitter_ms: u64Maximum jitter in milliseconds to add to each delay
backoff_multiplier: f64Multiplier for exponential backoff (e.g., 2.0 for doubling)
log_attempts: boolWhether to log retry attempts
Implementations§
Source§impl RetryConfig
impl RetryConfig
Sourcepub fn with_max_attempts(self, max_attempts: u32) -> Self
pub fn with_max_attempts(self, max_attempts: u32) -> Self
Set maximum number of retry attempts
Sourcepub fn with_base_delay_ms(self, base_delay_ms: u64) -> Self
pub fn with_base_delay_ms(self, base_delay_ms: u64) -> Self
Set base delay in milliseconds
Sourcepub fn with_max_elapsed_time(self, max_elapsed_time: Duration) -> Self
pub fn with_max_elapsed_time(self, max_elapsed_time: Duration) -> Self
Set maximum elapsed time for all retry attempts
Sourcepub fn with_jitter_ms(self, jitter_ms: u64) -> Self
pub fn with_jitter_ms(self, jitter_ms: u64) -> Self
Set maximum jitter in milliseconds
Sourcepub fn with_backoff_multiplier(self, backoff_multiplier: f64) -> Self
pub fn with_backoff_multiplier(self, backoff_multiplier: f64) -> Self
Set backoff multiplier for exponential backoff
Sourcepub fn with_logging(self, log_attempts: bool) -> Self
pub fn with_logging(self, log_attempts: bool) -> Self
Enable or disable retry attempt logging
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 (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 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 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