pub struct RwClient<Read, Write> { /* private fields */ }
Expand description

A client contains two clients.

One is used for read operations One is used for write operations that consume gas ["eth_sendTransaction", "eth_sendRawTransaction"]

Note: if the method is unknown this client falls back to the read client

Implementations

Creates a new client using two different clients

Example
 async fn t(){
use ethers_providers::{Http, RwClient, Ws};
let http = Http::new(Url::parse("http://localhost:8545").unwrap());
let ws = Ws::connect("ws://localhost:8545").await.unwrap();
let rw = RwClient::new(http, ws);

Returns the client used for read operations

Returns the client used for read operations

Returns a new RwClient with transposed clients

Consumes the client and returns the underlying clients

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Sends a POST request with the provided method and the params serialized as JSON over HTTP

A JSON-RPC Error

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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