Struct httpcodec::Response
[−]
[src]
pub struct Response<T> { /* fields omitted */ }
HTTP response message.
Methods
impl<T> Response<T>
[src]
pub fn new(
version: HttpVersion,
status: StatusCode,
reason: ReasonPhrase,
body: T
) -> Self
[src]
version: HttpVersion,
status: StatusCode,
reason: ReasonPhrase,
body: T
) -> Self
Makes a new Response
instance with the given status-line components and body.
pub fn http_version(&self) -> HttpVersion
[src]
Returns the HTTP version of the response.
pub fn status_code(&self) -> StatusCode
[src]
Returns the status code of the response.
pub fn reason_phrase(&self) -> ReasonPhrase
[src]
Returns the reason phrase of the response.
pub fn header(&self) -> Header
[src]
Returns the header of the response.
pub fn header_mut(&mut self) -> HeaderMut
[src]
Returns the mutable header of the response.
pub fn body(&self) -> &T
[src]
Returns a reference to the body of the response.
pub fn body_mut(&mut self) -> &mut T
[src]
Returns a mutable reference to the body of the response.
pub fn into_body(self) -> T
[src]
Takes ownership of the response, and returns its body.
Trait Implementations
impl<T: Debug> Debug for Response<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more