Struct jsonrpc::client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

A JSON-RPC client.

Create a new Client using one of the transport-specific constructors e.g., Client::simple_http for a bare-minimum HTTP transport.

Implementations§

Creates a new client with the given transport.

Builds a request.

To construct the arguments, one can use one of the shorthand methods crate::arg or crate::try_arg.

Sends a request to a client.

Sends a batch of requests to the client.

Note that the requests need to have valid IDs, so it is advised to create the requests with Client::build_request.

Returns

The return vector holds the response for the request at the corresponding index. If no response was provided, it’s None.

Make a request and deserialize the response.

To construct the arguments, one can use one of the shorthand methods crate::arg or crate::try_arg.

Creates a new JSON-RPC client using a bare-minimum HTTP transport.

Trait Implementations§

Formats the value using the given formatter. Read more

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.

Calls U::from(self).

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

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.