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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more

Should always be Self

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.

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