Trait reqwest_eventsource::retry::RetryPolicy
source · pub trait RetryPolicy {
// Required methods
fn retry(
&self,
error: &Error,
last_retry: Option<(usize, Duration)>
) -> Option<Duration>;
fn set_reconnection_time(&mut self, duration: Duration);
}
Expand description
Describes how an EventSource
should retry on receiving an Error
Required Methods§
sourcefn 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 retry
sourcefn 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