[−][src]Struct httpbis::Client
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]
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]
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]
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]
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(
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>,
end_stream: bool
) -> Pin<Box<dyn Future<Output = Result<(ClientRequest, Response)>> + Send>>
[src]
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>,
end_stream: bool
) -> Pin<Box<dyn Future<Output = Result<(ClientRequest, Response)>> + Send>>
pub fn start_request_end_stream(
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>
) -> Response
[src]
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>
) -> Response
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]
&self,
path: &str,
authority: &str
) -> Pin<Box<dyn Future<Output = Result<(ClientRequest, Response)>> + Send>>
pub fn wait_for_connect(
&self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>
[src]
&self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send>>
Create a future which waits for successful connection.
Trait Implementations
impl ClientInterface for Client
[src]
fn start_request_low_level(
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>,
end_stream: bool,
stream_handler: Box<dyn ClientStreamCreatedHandler>
) -> Result<()>
[src]
&self,
headers: Headers,
body: Option<Bytes>,
trailers: Option<Headers>,
end_stream: bool,
stream_handler: Box<dyn ClientStreamCreatedHandler>
) -> Result<()>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,