pub struct RetryPolicy {
pub max_retries: u32,
pub base_delay: Duration,
pub max_delay: Duration,
}Expand description
Policy for retrying transient network failures.
The delay before the retry following a (0-based) attempt is
base_delay * 2^attempt, capped at max_delay, plus a little jitter.
Fields§
§max_retries: u32Maximum number of retries after the initial attempt (so total attempts is
max_retries + 1). Zero disables retrying.
base_delay: DurationThe base backoff delay, doubled on each successive retry.
max_delay: DurationThe ceiling on any single backoff delay.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
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