[][src]Struct http_req::response::Response

pub struct Response { /* fields omitted */ }

Represents an HTTP response.

It contains Headers and Status parsed from response.

Methods

impl Response[src]

pub fn from_head(head: &[u8]) -> Result<Response, Error>[src]

Creates new Response with head - status and headers - parsed from a slice of bytes

pub fn try_from<T: Write>(res: &[u8], writer: &mut T) -> Result<Response, Error>[src]

Parses Response from slice of bytes. Writes it's body to writer.

pub fn status_code(&self) -> StatusCode[src]

Returns status code of this Response.

pub fn version(&self) -> &str[src]

Returns HTTP version of this Response.

pub fn reason(&self) -> &str[src]

Returns reason of this Response.

pub fn headers(&self) -> &Headers[src]

Returns headers of this Response.

pub fn content_len(&self) -> Result<usize, ParseErr>[src]

Returns length of the content of this Response as a Result, according to information included in headers. If there is no such an information, returns Ok(0).

Trait Implementations

impl PartialEq<Response> for Response[src]

impl Clone for Response[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Response[src]

Auto Trait Implementations

impl Send for Response

impl Sync for Response

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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