alloy_transport::layers

Trait RetryPolicy

Source
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§

Source

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

Whether to retry the request based on the given error

Source

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

Providers may include the backoff in the error response directly

Implementors§