pub struct RetryPolicy {
pub max_retries: u32,
pub initial_delay_ms: u64,
pub backoff_factor: f64,
pub max_delay_ms: u64,
pub predicate: RetryPredicate,
}Expand description
Policy governing how RetryConnection retries failed operations.
The delay sequence for retries is:
initial_delay_ms * backoff_factor^attempt, capped at max_delay_ms.
Fields§
§max_retries: u32Maximum number of retry attempts after the first failure.
initial_delay_ms: u64Initial delay in milliseconds before the first retry.
backoff_factor: f64Multiplicative backoff factor applied to each successive delay.
max_delay_ms: u64Upper bound on the delay between retries in milliseconds.
predicate: RetryPredicatePredicate that returns true for transient errors worth retrying.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
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 RetryPolicy
impl Debug for RetryPolicy
Auto Trait Implementations§
impl !RefUnwindSafe for RetryPolicy
impl !UnwindSafe for RetryPolicy
impl Freeze for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin 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