pub struct RetryPolicy { /* private fields */ }Expand description
A bounded retry policy for explicit HTTP 429 responses.
Transport failures are never retried. The default replays only GET, HEAD and OPTIONS requests, and only when their bodies can be cloned by reqwest.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub const fn new(
max_retries: u8,
initial_delay: Duration,
max_delay: Duration,
) -> Self
pub const fn new( max_retries: u8, initial_delay: Duration, max_delay: Duration, ) -> Self
Set the number of additional attempts and the backoff bounds.
A Retry-After value above max_delay returns the 429 without waiting.
Sourcepub const fn retry_non_idempotent(self, enabled: bool) -> Self
pub const fn retry_non_idempotent(self, enabled: bool) -> Self
Permit replay of mutation requests with cloneable bodies after a 429.
Enable only when the endpoint rejects rate-limited requests before any side effect. This is not a general idempotency guarantee for POST or PATCH.
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
impl Copy for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
impl Eq for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
impl StructuralPartialEq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.