Struct reqwest_eventsource::retry::ExponentialBackoff
source · pub struct ExponentialBackoff {
pub start: Duration,
pub factor: f64,
pub max_duration: Option<Duration>,
pub max_retries: Option<usize>,
}
Expand description
A RetryPolicy
which backs off exponentially
Fields§
§start: Duration
The start of the backoff
factor: f64
The factor of which to backoff by
max_duration: Option<Duration>
The maximum duration to delay
max_retries: Option<usize>
The maximum number of retries before giving up
Implementations§
Trait Implementations§
source§impl Clone for ExponentialBackoff
impl Clone for ExponentialBackoff
source§fn clone(&self) -> ExponentialBackoff
fn clone(&self) -> ExponentialBackoff
Returns a copy 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 ExponentialBackoff
impl Debug for ExponentialBackoff
source§impl RetryPolicy for ExponentialBackoff
impl RetryPolicy for ExponentialBackoff
source§fn retry(
&self,
_error: &Error,
last_retry: Option<(usize, Duration)>
) -> Option<Duration>
fn retry( &self, _error: &Error, last_retry: Option<(usize, Duration)> ) -> Option<Duration>
Submit a new retry delay based on the
Error
, last retry number and duration, if
available. A policy may also return None
if it does not want to retrysource§fn set_reconnection_time(&mut self, duration: Duration)
fn set_reconnection_time(&mut self, duration: Duration)
Set a new reconnection time if received from an
Event
Auto Trait Implementations§
impl Freeze for ExponentialBackoff
impl RefUnwindSafe for ExponentialBackoff
impl Send for ExponentialBackoff
impl Sync for ExponentialBackoff
impl Unpin for ExponentialBackoff
impl UnwindSafe for ExponentialBackoff
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