Trait RetryPolicy

Source
pub trait RetryPolicy<E>:
    Send
    + Sync
    + Debug {
    // Required methods
    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§

Source

fn should_retry(&self, error: &E) -> bool

Whether to retry the request based on the given error

Source

fn backoff_hint(&self, error: &E) -> Option<Duration>

Providers may include the backoff in the error response directly

Implementors§