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

Gets a reference the request method.

Gets a mutable reference to the request method.

Gets a reference the request URI.

Gets a mutable reference to the request URI.

Get the request HTTP version.

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.

Takes the body out of the request, leaving a None in its place.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.