Struct axum::extract::RequestParts
source ·
[−]pub struct RequestParts<B> { /* private fields */ }
Expand description
The type used with FromRequest
to extract data from requests.
Has several convenience methods for getting owned parts of the request.
Implementations
Create a new RequestParts
.
You generally shouldn’t need to construct this type yourself, unless
using extractors outside of axum for example to implement a
tower::Service
.
Convert this RequestParts
back into a Request
.
Fails if
- The full
HeaderMap
has been extracted, that istake_headers
have been called. - The full
Extensions
has been extracted, that istake_extensions
have been called. - The request body has been extracted, that is
take_body
have been called.
Gets a mutable reference to the request method.
Gets a mutable reference to the request HTTP version.
Gets a reference to the request headers.
Returns None
if the headers has been taken by another extractor.
Gets a mutable reference to the request headers.
Returns None
if the headers has been taken by another extractor.
Takes the headers out of the request, leaving a None
in its place.
Gets a reference to the request extensions.
Returns None
if the extensions has been taken by another extractor.
Gets a mutable reference to the request extensions.
Returns None
if the extensions has been taken by another extractor.
Takes the extensions out of the request, leaving a None
in its place.
Gets a reference to the request body.
Returns None
if the body has been taken by another extractor.
Gets a mutable reference to the request body.
Returns None
if the body has been taken by another extractor.
Trait Implementations
Auto Trait Implementations
impl<B> !RefUnwindSafe for RequestParts<B>
impl<B> Send for RequestParts<B> where
B: Send,
impl<B> Sync for RequestParts<B> where
B: Sync,
impl<B> Unpin for RequestParts<B> where
B: Unpin,
impl<B> !UnwindSafe for RequestParts<B>
Blanket Implementations
Mutably borrows from an owned value. Read more
Create a new Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more