Struct iron::request::Request [-]  [+] [src]

pub struct Request<'a> {
    pub url: Url,
    pub remote_addr: SocketAddr,
    pub local_addr: SocketAddr,
    pub headers: Headers,
    pub body: Body<'a>,
    pub method: Method,
    pub extensions: TypeMap,
}

The Request given to all Middleware.

Stores all the properties of the client's request plus an TypeMap for data communication between middleware.

Fields

url

The requested URL.

remote_addr

The originating address of the request.

local_addr

The local address of the request.

headers

The request headers.

body

The request body as a reader.

method

The request method.

extensions

Extensible storage for data passed between middleware.

Methods

impl<'a> Request<'a>

fn from_http(req: HttpRequest<'a>, local_addr: SocketAddr) -> Result<Request<'a>, String>

Create a request from an HttpRequest.

This constructor consumes the HttpRequest.

Trait Implementations

impl<'a> Debug for Request<'a>

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

impl<'a> Extensible for Request<'a>

fn extensions(&self) -> &TypeMap

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

impl<'a> Plugin for Request<'a>

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<'a> Set for Request<'a>

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

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