pub struct RetryPolicy { /* private fields */ }Expand description
How a failed exchange is retried: max_retries extra attempts at most,
exponential backoff from base (200 ms, 400 ms, 800 ms, …) clamped to
max_delay per wait and max_total across the whole exchange. An
upstream-stated Retry-After replaces the computed delay and clamps
only to what max_total still allows.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn max_retries(self) -> u32
pub fn max_retries(self) -> u32
Extra attempts after the first send.
Sourcepub fn max_delay(self) -> Duration
pub fn max_delay(self) -> Duration
Ceiling on one computed wait. An upstream-stated Retry-After may
exceed this; only max_total caps it.
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Sets the retry count.
Sourcepub fn with_max_delay(self, max_delay: Duration) -> Self
pub fn with_max_delay(self, max_delay: Duration) -> Self
Sets the per-wait ceiling.
Sourcepub fn with_max_total(self, max_total: Duration) -> Self
pub fn with_max_total(self, max_total: Duration) -> Self
Sets the across-the-exchange ceiling.
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.