pub struct RetryPolicy { /* private fields */ }
Expand description
A policy for retrying API requests
Refresh the order state repeatedly, waiting delay
before the first attempt and increasing
the delay by a factor of backoff
after each attempt, until the timeout
is reached.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub const fn new() -> Self
pub const fn new() -> Self
A constructor for the default RetryPolicy
Will retry for 5s with an initial delay of 250ms and a backoff factor of 2.0.
Sourcepub const fn initial_delay(self, delay: Duration) -> Self
pub const fn initial_delay(self, delay: Duration) -> Self
Set the initial delay
This is the delay before the first retry attempt. The delay will be multiplied by the backoff factor after each attempt.
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
impl Copy 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 UnwindSafe for RetryPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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