Struct httpbis::Client [−][src]
pub struct Client { /* fields omitted */ }
Asynchronous HTTP/2 client.
Client connects to the single server address (which must be specified
in ClientBuilder
). When connection fails (because of network error
or protocol error) client is reconnected.
Methods
impl Client
[src]
impl Client
pub fn new_plain(host: &str, port: u16, conf: ClientConf) -> Result<Client>
[src]
pub fn new_plain(host: &str, port: u16, conf: ClientConf) -> Result<Client>
Create a new client connected to the specified host and port without using TLS.
pub fn new_tls<C: TlsConnector>(
host: &str,
port: u16,
conf: ClientConf
) -> Result<Client>
[src]
pub fn new_tls<C: TlsConnector>(
host: &str,
port: u16,
conf: ClientConf
) -> Result<Client>
Create a new client connected to the specified host and port using TLS.
pub fn new_plain_unix(addr: &str, conf: ClientConf) -> Result<Client>
[src]
pub fn new_plain_unix(addr: &str, conf: ClientConf) -> Result<Client>
Create a new client connected to the specified localhost Unix addr.
pub fn new_tls_unix<C: TlsConnector>(
addr: &str,
conf: ClientConf
) -> Result<Client>
[src]
pub fn new_tls_unix<C: TlsConnector>(
addr: &str,
conf: ClientConf
) -> Result<Client>
Create a new client connected to the specified localhost Unix addr using TLS.
pub fn new_expl<C: TlsConnector>(
addr: &SocketAddr,
tls: ClientTlsOption<C>,
conf: ClientConf
) -> Result<Client>
[src]
pub fn new_expl<C: TlsConnector>(
addr: &SocketAddr,
tls: ClientTlsOption<C>,
conf: ClientConf
) -> Result<Client>
Connect to server using plain or TLS protocol depending on tls
parameter.
pub fn start_request_simple(&self, headers: Headers, body: Bytes) -> Response
[src]
pub fn start_request_simple(&self, headers: Headers, body: Bytes) -> Response
Start HTTP/2 request.
pub fn start_get(&self, path: &str, authority: &str) -> Response
[src]
pub fn start_get(&self, path: &str, authority: &str) -> Response
Start HTTP/2 GET
request.
pub fn start_post(&self, path: &str, authority: &str, body: Bytes) -> Response
[src]
pub fn start_post(&self, path: &str, authority: &str, body: Bytes) -> Response
Start HTTP/2 POST
request.
pub fn wait_for_connect(&self) -> Box<Future<Item = (), Error = Error> + Send>
[src]
pub fn wait_for_connect(&self) -> Box<Future<Item = (), Error = Error> + Send>
Create a future which waits for successful connection.
Trait Implementations
impl Service for Client
[src]
impl Service for Client
fn start_request(
&self,
headers: Headers,
body: HttpStreamAfterHeaders
) -> Response
[src]
fn start_request(
&self,
headers: Headers,
body: HttpStreamAfterHeaders
) -> Response
Start HTTP/2 request. Read more
impl Drop for Client
[src]
impl Drop for Client