Struct iron::request::Request
[−]
[src]
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]
fn from_http(
req: HttpRequest<'a, 'b>,
local_addr: SocketAddr,
protocol: &Protocol
) -> Result<Request<'a, 'b>, String>
[src]
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>
[src]
impl<'a, 'b> Extensible for Request<'a, 'b>
[src]
fn extensions(&self) -> &TypeMap
[src]
Get a reference to the type's extension storage.
fn extensions_mut(&mut self) -> &mut TypeMap
[src]
Get a mutable reference to the type's extension storage.
impl<'a, 'b> Plugin 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]
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Clone,
<P as Key>::Value: Any,
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]
&mut self
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
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]
&mut self
) -> Result<&mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Self: Extensible,
<P as Key>::Value: Any,
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]
&mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
P: Plugin<Self>,
Create and evaluate a once-off instance of a plugin.