Struct ferrum::request::Request
[−]
[src]
pub struct Request { pub uri: Uri, pub uri_path_segments: Vec<String>, pub method: Method, pub version: HttpVersion, pub remote_addr: Option<SocketAddr>, pub headers: Headers, pub body: Option<Body>, pub extensions: TypeMap<TypeMapInner>, // 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
uri: Uri
The requested URI.
uri_path_segments: Vec<String>
The URI path segments collection
method: Method
The request method.
version: HttpVersion
The version of the HTTP protocol used.
remote_addr: Option<SocketAddr>
The originating address of the request. Some underlying transports may not have a socket address, such as Unix Sockets.
headers: Headers
The request headers.
body: Option<Body>
The request body.
extensions: TypeMap<TypeMapInner>
Extensible storage for data passed between middleware.
Methods
impl Request
[src]
fn new(request: HyperRequest) -> Request
[src]
Create a request from an HyperRequest.
This constructor consumes the HyperRequest.
fn take_body(&mut self) -> Body
[src]
Trait Implementations
impl Debug for Request
[src]
impl Extensible<TypeMapInner> for Request
[src]
fn extensions(&self) -> &TypeMap<TypeMapInner>
[src]
Get a reference to the type's extension storage.
fn extensions_mut(&mut self) -> &mut TypeMap<TypeMapInner>
[src]
Get a mutable reference to the type's extension storage.
impl Plugin for Request
[src]
fn get<'a, P>(
&'a mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Clone,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
[src]
&'a mut self
) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Clone,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
Return a copy of the plugin's produced value. Read more
fn get_ref<'a, P>(
&'a mut self
) -> Result<&'a <P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
[src]
&'a mut self
) -> Result<&'a <P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
Return a reference to the plugin's produced value. Read more
fn get_mut<'a, P>(
&'a mut self
) -> Result<&'a mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
[src]
&'a mut self
) -> Result<&'a mut <P as Key>::Value, <P as Plugin<Self>>::Error> where
A: 'a,
P: Plugin<Self>,
Self: Extensible<A>,
<P as Key>::Value: Any,
<P as Key>::Value: Implements<A>,
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.