Trait FromRequest

trait FromRequest<S, M = private::ViaRequest>: Sized

Types that can be created from requests.

Extractors that implement FromRequest can consume the request body and can thus only be run once for handlers.

If your extractor doesn't need to consume the request body then you should implement FromRequestParts and not FromRequest.

See axum::extract for more general docs about extractors.

Associated Types

type Rejection: TraitBound { trait_: Path { path: "IntoResponse", id: Id(172), args: None }, generic_params: [], modifier: None }

If the extractor fails it'll use this "rejection" type. A rejection is a kind of error that can be converted into a response.

Required Methods

fn from_request(req: Request, state: &S) -> impl Future<Output = Result<Self, <Self as >::Rejection>> + Send

Perform the extraction.

Implementors