pub struct RetryPolicy {
pub max_attempts: u32,
pub backoff: Duration,
pub give_up_after: Duration,
pub request_deadline: Option<Duration>,
pub idempotent: bool,
}Expand description
Reconnect-and-resubmit policy for retryable errors (handoff, host restart).
Fields§
§max_attempts: u32§backoff: Duration§give_up_after: DurationGive up after this long regardless of attempts. Not a request timeout: a single call may run as long as the host keeps it alive.
request_deadline: Option<Duration>Per-attempt connect + request deadline (None = unbounded).
idempotent: boolThe request is safe to run twice. When false (the default) a request is resubmitted only if the host provably did not run it (service unavailable at connect, or an explicit host handoff); a connection that closed after the request was written is returned as-is, and a timeout is returned as-is. When true, a connection that closed after the write and a timeout are resubmitted too.
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