[][src]Struct mini_async_http::Response

pub struct Response {
    pub code: i32,
    pub reason: String,
    pub version: Version,
    pub headers: Headers,
    pub body: Option<Vec<u8>>,
}

Represent an HTTP response

Fields

code: i32reason: Stringversion: Versionheaders: Headersbody: Option<Vec<u8>>

Implementations

impl Response[src]

pub fn code(&self) -> i32[src]

Return status code of the response

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

Return the reason phrase of the response

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

Return the HTTP version of the response

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

Return the headers of the response

pub fn body(&self) -> Option<&Vec<u8>>[src]

Return the body as a byte slice of the response

pub fn body_as_string(&self) -> Option<String>[src]

Return the body interpreted as an utf 8 string

Trait Implementations

impl Debug for Response[src]

impl Display for Response[src]

impl PartialEq<Response> for Response[src]

impl StructuralPartialEq for Response[src]

Auto Trait Implementations

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> ToString for T where
    T: Display + ?Sized
[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.