Struct reqwest_eventsource::retry::Constant
source · pub struct Constant {
pub delay: Duration,
pub max_retries: Option<usize>,
}
Expand description
A RetryPolicy
which always emits the same delay
Fields§
§delay: Duration
The delay to return
max_retries: Option<usize>
The maximum number of retries to return before giving up
Implementations§
Trait Implementations§
source§impl RetryPolicy for Constant
impl RetryPolicy for Constant
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 Constant
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnwindSafe for Constant
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