pub trait RetryPolicy:
Send
+ Sync
+ Debug {
// Required methods
fn should_retry(&self, error: &TransportError) -> bool;
fn backoff_hint(&self, error: &TransportError) -> Option<Duration>;
}
Expand description
RetryBackoffLayer RetryPolicy defines logic for which TransportError instances should the client retry the request and try to recover from.
Required Methods§
Sourcefn should_retry(&self, error: &TransportError) -> bool
fn should_retry(&self, error: &TransportError) -> bool
Whether to retry the request based on the given error
Sourcefn backoff_hint(&self, error: &TransportError) -> Option<Duration>
fn backoff_hint(&self, error: &TransportError) -> Option<Duration>
Providers may include the backoff
in the error response directly