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]
impl<C: ClientCreator> HttpTransportBuilder<C>
pub fn with_client(client_creator: C) -> HttpTransportBuilder<C>
[src]
pub fn with_client(client_creator: C) -> HttpTransportBuilder<C>
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();
pub fn timeout(self, duration: Duration) -> Self
[src]
pub fn timeout(self, duration: Duration) -> Self
Configure the timeout for RPC requests.
pub fn standalone(self) -> Result<HttpTransport>
[src]
pub fn standalone(self) -> Result<HttpTransport>
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> Send for HttpTransportBuilder<C>
impl<C> Sync for HttpTransportBuilder<C> where
C: Sync,
impl<C> Sync for HttpTransportBuilder<C> where
C: Sync,