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