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

pub struct Request<'a, 'b: 'a> {
    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,
    pub version: HttpVersion,
    // some fields omitted
}

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: Url

The requested URL.

remote_addr: SocketAddr

The originating address of the request.

local_addr: SocketAddr

The local address of the request.

headers: Headers

The request headers.

body: Body<'a, 'b>

The request body as a reader.

method: Method

The request method.

extensions: TypeMap

Extensible storage for data passed between middleware.

version: HttpVersion

The version of the HTTP protocol used.

Methods

impl<'a, 'b> Request<'a, 'b>[src]

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

Create a request from an HttpRequest.

This constructor consumes the HttpRequest.

Trait Implementations

impl<'a, 'b> Debug for Request<'a, 'b>[src]

impl<'a, 'b> Extensible for Request<'a, 'b>[src]

impl<'a, 'b> Pluggable for Request<'a, 'b>[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<'a, 'b, H> Modifier<Request<'a, 'b>> for Header<H> where
    H: Header + HeaderFormat
[src]

impl<'a, 'b> Set for Request<'a, 'b>[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<'a, 'b> !Sync for Request<'a, 'b>

impl<'a, 'b> !Send for Request<'a, 'b>

impl<'a, 'b> Unpin for Request<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !RefUnwindSafe for Request<'a, 'b>

impl<'a, 'b> !UnwindSafe for Request<'a, 'b>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<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