[−][src]Trait hyper::http::message::HttpMessage
The trait provides an API for sending an receiving HTTP messages.
Required Methods
fn set_outgoing(&mut self, head: RequestHead) -> Result<RequestHead>
Initiates a new outgoing request.
Only the request's head is provided (in terms of the RequestHead
struct).
After this, the HttpMessage
instance can be used as an io::Write
in order to write the
body of the request.
fn get_incoming(&mut self) -> Result<ResponseHead>
Obtains the incoming response and returns its head (i.e. the ResponseHead
struct)
After this, the HttpMessage
instance can be used as an io::Read
in order to read out
the response body.
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
Set the read timeout duration for this message.
fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
Set the write timeout duration for this message.
fn close_connection(&mut self) -> Result<()>
Closes the underlying HTTP connection.
fn has_body(&self) -> bool
Returns whether the incoming message has a body.
Provided Methods
fn set_proxied(&mut self, val: bool)
Called when the Client wishes to use a Proxy.
Methods
impl dyn HttpMessage
[src]
impl dyn HttpMessage
pub fn is<T: Any>(&self) -> bool
[src]
pub fn is<T: Any>(&self) -> bool
Is the underlying type in this trait object a T?
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
[src]
pub fn downcast_ref<T: Any>(&self) -> Option<&T>
If the underlying type is T, get a reference to the contained data.
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
[src]
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>
If the underlying type is T, get a mutable reference to the contained data.
pub fn downcast<T: Any>(
self: Box<dyn HttpMessage>
) -> Result<Box<T>, Box<dyn HttpMessage>>
[src]
pub fn downcast<T: Any>(
self: Box<dyn HttpMessage>
) -> Result<Box<T>, Box<dyn HttpMessage>>
If the underlying type is T, extract it.
Implementors
impl HttpMessage for Http11Message
[src]
impl HttpMessage for Http11Message
fn set_outgoing(&mut self, head: RequestHead) -> Result<RequestHead>
[src]
fn set_outgoing(&mut self, head: RequestHead) -> Result<RequestHead>
fn get_incoming(&mut self) -> Result<ResponseHead>
[src]
fn get_incoming(&mut self) -> Result<ResponseHead>
fn has_body(&self) -> bool
[src]
fn has_body(&self) -> bool
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
fn set_read_timeout(&self, dur: Option<Duration>) -> Result<()>
fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
[src]
fn set_write_timeout(&self, dur: Option<Duration>) -> Result<()>
fn close_connection(&mut self) -> Result<()>
[src]
fn close_connection(&mut self) -> Result<()>
fn set_proxied(&mut self, val: bool)
[src]
fn set_proxied(&mut self, val: bool)