pub struct RetryPolicy {
pub max_attempts: usize,
pub backoff: Backoff,
pub retry_writes: bool,
}Expand description
Retry limits and backoff behavior for RetryClient.
Fields§
§max_attempts: usizeMaximum total attempts, including the initial request.
backoff: BackoffDelay strategy between attempts.
retry_writes: boolWhether writes may be retried; disabled by default to avoid duplicate effects.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn constant(max_attempts: usize, delay: Duration) -> Self
pub fn constant(max_attempts: usize, delay: Duration) -> Self
Creates a policy with a fixed delay and writes disabled.
Sourcepub fn exponential(
max_attempts: usize,
initial: Duration,
max: Duration,
) -> Self
pub fn exponential( max_attempts: usize, initial: Duration, max: Duration, ) -> Self
Creates a factor-two exponential policy capped at max.
Sourcepub fn retry_writes(self, retry_writes: bool) -> Self
pub fn retry_writes(self, retry_writes: bool) -> Self
Enables or disables write retries.
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 moreAuto 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