pub struct Retry { /* private fields */ }Expand description
Retry a request up to N times, with a default of 3. The default back-off delay is 2 seconds.
Implementations§
Source§impl Retry
impl Retry
pub fn new() -> Self
Sourcepub fn backoff_delay(self, delay: Duration) -> Self
pub fn backoff_delay(self, delay: Duration) -> Self
Set the back-off delay between retries, if the server doesn’t specify a delay.
Sourcepub fn max_retries(self, max_retries: usize) -> Self
pub fn max_retries(self, max_retries: usize) -> Self
Set the maximum number of retries.
pub fn retry_codes(self, codes: impl Into<Cow<'static, [u16]>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Retry
impl RefUnwindSafe for Retry
impl Send for Retry
impl Sync for Retry
impl Unpin for Retry
impl UnwindSafe for Retry
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