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

pub struct Request<'a, 'b> {
    pub url: Url,
    pub remote_addr: SocketAddr,
    pub local_addr: SocketAddr,
    pub headers: Headers,
    pub body: Body<'a, 'b>,
    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, 'b> Request<'a, 'b>

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

Create a request from an HttpRequest.

This constructor consumes the HttpRequest.

Trait Implementations

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

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

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

fn extensions(&self) -> &TypeMap

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

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

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

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

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

fn compute<P>(&mut self) -> Result<P::Value, P::Error> where P: Plugin<Self>

impl<'a, 'b> Set for Request<'a, 'b>

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

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