[][src]Struct httpbis::Client

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.

Implementations

impl Client[src]

pub fn new_plain(host: &str, port: u16, conf: ClientConf) -> Result<Client>[src]

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]

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]

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]

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]

Connect to server using plain or TLS protocol depending on tls parameter.

pub fn start_request(
    &self,
    headers: Headers,
    body: Option<Bytes>,
    trailers: Option<Headers>,
    end_stream: bool
) -> Pin<Box<dyn Future<Output = Result<(ClientRequest, Response)>> + Send>>
[src]

pub fn start_request_end_stream(
    &self,
    headers: Headers,
    body: Option<Bytes>,
    trailers: Option<Headers>
) -> Response
[src]

pub fn start_get(&self, path: &str, authority: &str) -> Response[src]

Start HTTP/2 GET request.

pub fn start_post(&self, path: &str, authority: &str, body: Bytes) -> Response[src]

Start HTTP/2 POST request.

pub fn start_post_sink(
    &self,
    path: &str,
    authority: &str
) -> Pin<Box<dyn Future<Output = Result<(ClientRequest, Response)>> + Send>>
[src]

pub fn wait_for_connect(
    &self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>
[src]

Create a future which waits for successful connection.

Trait Implementations

impl ClientInterface for Client[src]

impl Debug for Client[src]

impl Drop for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.