Trait jsonrpc_client_http::ClientCreator
[−]
[src]
pub trait ClientCreator: Send + 'static { type Connect: Connect; type Error: Error + Send; fn create(
&self,
handle: &Handle
) -> Result<Client<Self::Connect, Body>, Self::Error>; }
Trait for types able to produce Hyper Client
s for use in HttpTransport
.
Associated Types
type Connect: Connect
The connector type inside the Client
created by this type.
type Error: Error + Send
The error emitted by this type in case creating the Client
failed.
Required Methods
fn create(
&self,
handle: &Handle
) -> Result<Client<Self::Connect, Body>, Self::Error>
&self,
handle: &Handle
) -> Result<Client<Self::Connect, Body>, Self::Error>
Tries to create a Hyper Client
based on the given Tokio Handle
.
Implementors
impl ClientCreator for DefaultTlsClient type Connect = HttpsConnector<HttpConnector>; type Error = Error;
impl ClientCreator for DefaultClient type Connect = HttpConnector; type Error = Error;
impl<C, E, F> ClientCreator for F where
C: Connect,
E: Error + Send,
F: Fn(&Handle) -> Result<Client<C, Body>, E>,
F: Send + 'static, type Connect = C; type Error = E;