pub struct RetryPolicy {
pub max_retries: u32,
pub backoff: Duration,
pub max_backoff: Duration,
pub on_status: Vec<u16>,
pub retry_non_idempotent: bool,
}Expand description
Opt-in automatic-retry policy. The default (RetryPolicy::default) has
max_retries == 0, i.e. retries are off — the client makes exactly one
attempt per request. Enable with PulseClientBuilder::retry.
Fields§
§max_retries: u32Maximum number of retries after the first attempt. 0 = off (default).
backoff: DurationBase backoff; the per-attempt ceiling is backoff * 2^attempt.
max_backoff: DurationPer-attempt backoff cap.
on_status: Vec<u16>Retryable 5xx statuses (default 502, 503, 504).
retry_non_idempotent: boolWhen true, also retries non-idempotent methods (POST/PATCH) on
5xx/transport. Default false → only GET/HEAD/PUT/DELETE are retried on
those, so a POST create is never silently duplicated.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn with_max_retries(max_retries: u32) -> Self
pub fn with_max_retries(max_retries: u32) -> Self
A policy that retries up to max_retries times with otherwise-default
backoff (200ms base, 10s cap) and the default retryable statuses.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
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