Struct iron::response::Response [-]  [+] [src]

pub struct Response {
    pub status: Option<Status>,
    pub headers: Headers,
    pub extensions: TypeMap,
    pub body: Option<Box<Reader + Send>>,
}

The response representation given to Middleware

Fields

status

The response status-code.

headers

The headers of the response.

extensions

A TypeMap to be used as an extensible storage for data associated with this Response.

body

The body of the response.

This is a Reader for generality, most data should be sent using either serve or serve_file.

Arbitrary Readers can be sent by assigning to body.

Methods

impl Response

fn new() -> Response

Construct a blank Response

fn with<M: Modifier<Response>>(m: M) -> Response

Construct a Response with the specified modifier pre-applied.

Trait Implementations

impl Debug for Response

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for Response

fn fmt(&self, f: &mut Formatter) -> Result

impl Extensible for Response

fn extensions(&self) -> &TypeMap

fn extensions_mut(&mut self) -> &mut TypeMap

impl Plugin for Response

fn get<P>(&mut self) -> Option<<P as Key>::Value> where P: Plugin<Self>, <P as Key>::Value: Clone, <P as Key>::Value: 'static, Self: Extensible

fn get_ref<P>(&mut self) -> Option<&<P as Key>::Value> where P: Plugin<Self>, <P as Key>::Value: 'static, Self: Extensible

fn get_mut<P>(&mut self) -> Option<&mut <P as Key>::Value> where P: Plugin<Self>, <P as Key>::Value: 'static, Self: Extensible

fn compute<P>(&mut self) -> Option<<P as Key>::Value> where P: Plugin<Self>

impl Set for Response

fn set<M: Modifier<Self>>(self, modifier: M) -> Self

fn set_mut<M: Modifier<Self>>(&mut self, modifier: M) -> &mut Self