Struct fire_http_representation::response::Response[][src]

pub struct Response {
    pub header: ResponseHeader,
    pub body: Body,
}
Expand description

The response created from a server.

Fields

header: ResponseHeaderbody: Body

Implementations

impl Response[src]

pub fn new(header: ResponseHeader, body: Body) -> Self[src]

Creates a new Response.

pub fn builder() -> ResponseBuilder[src]

Creates a new Response with a builder.

pub fn header(&self) -> &ResponseHeader[src]

Get the response header by reference.

pub fn take_body(&mut self) -> Body[src]

Takes the body replacing it with an empty one.

Note

If you use the builder to create a Response you should probably reset the content-length header.

Trait Implementations

impl Debug for Response[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<Body> for Response[src]

fn from(body: Body) -> Self[src]

Performs the conversion.

impl From<StatusCode> for Response[src]

fn from(status_code: StatusCode) -> Self[src]

Performs the conversion.

Auto Trait Implementations

impl !RefUnwindSafe for Response

impl Send for Response

impl Sync for Response

impl Unpin for Response

impl !UnwindSafe for Response

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.