pub struct RpcClient { /* private fields */ }
Available on crate feature rpc-client only.
Expand description

A simple RPC client for calling methods using HTTP POST.

Implementations

Creates a new RPC client connected to the given endpoint with the provided credentials. The credentials should be a base64 encoding of a user name and password joined by a colon, as is required for HTTP basic access authentication.

Calls a method with the response encoded in JSON format and interpreted as type T.

Trait Implementations

Returns the header for a given hash. A height hint may be provided in case a block source cannot easily find headers based on a hash. This is merely a hint and thus the returned header must have the same hash as was requested. Otherwise, an error must be returned. Read more

Returns the block for a given hash. A headers-only block source should return a Transient error. Read more

Returns the hash of the best block and, optionally, its height. 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.