pub struct RetryPolicy {
pub max_attempts: u32,
pub base_delay: Duration,
}Expand description
Configuration for with_backoff.
max_attempts includes the first try (so max_attempts = 3 means up to
two retries). base_delay is the initial backoff; subsequent delays
double via base_delay * 2^(attempt-1).
Fields§
§max_attempts: u32Total attempts including the first try.
base_delay: DurationInitial backoff duration; doubles each retry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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