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

pub struct Response {
    pub status: Option<Status>,
    pub headers: Headers,
    pub extensions: TypeMap,
    pub body: Option<Box<dyn WriteBody>>,
}

The response representation given to Middleware

Fields

status: Option<Status>

The response status-code.

headers: Headers

The headers of the response.

extensions: TypeMap

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

body: Option<Box<dyn WriteBody>>

The body of the response.

Methods

impl Response[src]

pub fn new() -> Response[src]

Construct a blank Response

pub fn with<M: Modifier<Response>>(m: M) -> Response[src]

Construct a Response with the specified modifier pre-applied.

Trait Implementations

impl Debug for Response[src]

impl Display for Response[src]

impl Extensible for Response[src]

impl Pluggable for Response[src]

fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
    P: Plugin<Self>,
    Self: Extensible,
    <P as Key>::Value: Clone,
    <P as Key>::Value: Any
[src]

Return a copy of the plugin's produced value. Read more

fn get_ref<P>(
    &mut self
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error> where
    P: Plugin<Self>,
    Self: Extensible,
    <P as Key>::Value: Any
[src]

Return a reference to the plugin's produced value. Read more

fn get_mut<P>(
    &mut self
) -> Result<&mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
    P: Plugin<Self>,
    Self: Extensible,
    <P as Key>::Value: Any
[src]

Return a mutable reference to the plugin's produced value. Read more

fn compute<P>(
    &mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
    P: Plugin<Self>, 
[src]

Create and evaluate a once-off instance of a plugin.

impl Modifier<Response> for Mime[src]

impl Modifier<Response> for Box<dyn WriteBody>[src]

impl<R: Read + Send + 'static> Modifier<Response> for BodyReader<R>[src]

impl Modifier<Response> for String[src]

impl Modifier<Response> for Vec<u8>[src]

impl<'a> Modifier<Response> for &'a str[src]

impl<'a> Modifier<Response> for &'a [u8][src]

impl Modifier<Response> for File[src]

impl<'a> Modifier<Response> for &'a Path[src]

fn modify(self, res: &mut Response)[src]

Set the body to the contents of the File at this path.

Panics

Panics if there is no file at the passed-in Path.

impl Modifier<Response> for PathBuf[src]

fn modify(self, res: &mut Response)[src]

Set the body to the contents of the File at this path.

Panics

Panics if there is no file at the passed-in Path.

impl Modifier<Response> for Status[src]

impl<H> Modifier<Response> for Header<H> where
    H: Header + HeaderFormat
[src]

impl Modifier<Response> for Redirect[src]

impl Modifier<Response> for RedirectRaw[src]

impl Set for Response[src]

fn set<M>(self, modifier: M) -> Self where
    M: Modifier<Self>, 
[src]

Modify self using the provided modifier.

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

Modify self through a mutable reference with the provided modifier.

Auto Trait Implementations

impl !Sync for Response

impl Unpin for Response

impl !Send for Response

impl !UnwindSafe for Response

impl !RefUnwindSafe for Response

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> UnsafeAny for T where
    T: Any