pub struct RetryClient<T> where
    T: JsonRpcClient,
    T::Error: Sync + Send + 'static, 
{ /* private fields */ }
Expand description

RetryClient presents as a wrapper around JsonRpcClient that will retry requests based with an exponential backoff and filtering based on RetryPolicy.

Implementations

Example:

use ethers_providers::{Http, RetryClient, HttpRateLimitRetryPolicy};
use std::time::Duration;
use url::Url;

let http = Http::new(Url::parse("http://localhost:8545").unwrap());
let delay = Duration::new(10, 0);
let client = RetryClient::new(http, Box::new(HttpRateLimitRetryPolicy), 10, 1);

Sets the free compute units per second limit.

This is the maximum number of weighted request that can be handled per second by the endpoint before rate limit kicks in.

This is used to guesstimate how long to wait until to retry again

Trait Implementations

Formats the value using the given formatter. Read more

A JSON-RPC Error

Sends a request with the provided JSON-RPC and parameters serialized as JSON

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more