Trait FromRequestParts

Source
pub trait FromRequestParts: Sized {
    // Required method
    fn from_request_parts(
        parts: &mut Parts,
    ) -> impl Future<Output = Result<Self>> + Send;
}
Expand description

Trait for extractors that don’t consume the request body.

Extractors implementing this trait are used in route handlers that don’t consume the request and therefore can be used multiple times per request.

If you need to consume the body of the request, use FromRequest instead.

See crate::request::extractors documentation for more information about extractors.

Required Methods§

Source

fn from_request_parts( parts: &mut Parts, ) -> impl Future<Output = Result<Self>> + Send

Extracts data from the request parts.

§Errors

Throws an error if the extractor fails to extract the data from the request parts.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§