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,
/* private fields */
}
Expand description
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.
Implementations§
Trait Implementations§
Source§impl<'a, 'b> Extensible for Request<'a, 'b>
impl<'a, 'b> Extensible for Request<'a, 'b>
Source§fn extensions(&self) -> &TypeMap
fn extensions(&self) -> &TypeMap
Get a reference to the type’s extension storage.
Source§fn extensions_mut(&mut self) -> &mut TypeMap
fn extensions_mut(&mut self) -> &mut TypeMap
Get a mutable reference to the type’s extension storage.
Source§impl<'a, 'b> Pluggable for Request<'a, 'b>
impl<'a, 'b> Pluggable for Request<'a, 'b>
Source§fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error>
fn get<P>(&mut self) -> Result<<P as Key>::Value, <P as Plugin<Self>>::Error>
Return a copy of the plugin’s produced value. Read more
Source§fn get_ref<P>(
&mut self,
) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error>
fn get_ref<P>( &mut self, ) -> Result<&<P as Key>::Value, <P as Plugin<Self>>::Error>
Return a reference to the plugin’s produced value. Read more
Auto Trait Implementations§
impl<'a, 'b> Freeze for Request<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for Request<'a, 'b>
impl<'a, 'b> !Send for Request<'a, 'b>
impl<'a, 'b> !Sync for Request<'a, 'b>
impl<'a, 'b> Unpin for Request<'a, 'b>
impl<'a, 'b> !UnwindSafe for Request<'a, 'b>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more