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

A simple REST client for requesting resources using HTTP GET.

Implementations

Creates a new REST client connected to the given endpoint.

The endpoint should contain the REST path component (e.g., http://127.0.0.1:8332/rest).

Requests a resource encoded in F 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.