Skip to content

Instantly share code, notes, and snippets.

@muja
Last active August 29, 2015 14:25
Show Gist options
  • Save muja/67869fe3ba1777d90892 to your computer and use it in GitHub Desktop.
Save muja/67869fe3ba1777d90892 to your computer and use it in GitHub Desktop.
/// Create a new client with a specific connector.
pub fn with_connector<C, S>(connector: C) -> Client
where C: NetworkConnector<Stream=S> + Send + Sync + 'static, S: NetworkStream + Send {
Client::with_protocol(Http11Protocol::with_connector(connector))
}
/// Create a new client with a specific connector.
pub fn with_connector<C, S>(connector: C) -> Client
where C: Into<NetworkConnector<Stream=S>> + Send + Sync + 'static, S: NetworkStream + Send {
Client::with_protocol(Http11Protocol::with_connector(connector.into()))
}
/// Create a new client with a specific connector.
pub fn with_connector<C, S>(connector: C) -> Client
where C: Into<NetworkConnector<Stream=S> + Send + Sync + 'static>, S: NetworkStream + Send {
Client::with_protocol(Http11Protocol::with_connector(connector.into()))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment