Struct jsonrpc_client_http::HttpTransportBuilder[][src]

pub struct HttpTransportBuilder<C: ClientCreator> { /* fields omitted */ }

Builder type for HttpTransport.

Can be finished by the standalone() method, where it is backed by its own Tokio Core running in a separate thread, or by the shared(handle) method, where it is backed by the Tokio Handle given to it.

Methods

impl<C: ClientCreator> HttpTransportBuilder<C>
[src]

Returns a builder to create a HttpTransport using the provided ClientCreator.

Example


HttpTransportBuilder::with_client(|handle: &Handle| {
    Ok(hyper::Client::configure().keep_alive(false).build(handle)) as Result<_, io::Error>
}).standalone()
    .unwrap();

Configure the timeout for RPC requests.

Creates the final HttpTransport backed by its own Tokio Core running in a separate thread that is exclusive to this transport instance. To make the transport run on an existing event loop, use the shared method instead.

Creates the final HttpTransport backed by the Tokio Handle given to it. Use the standalone method to make it create its own internal event loop.

Auto Trait Implementations

impl<C> Send for HttpTransportBuilder<C>

impl<C> Sync for HttpTransportBuilder<C> where
    C: Sync