Trait FromRequestParts

Source
pub trait FromRequestParts: Sized {
    type Error: IntoResponse + Send + Sync;

    // Required method
    fn from_request_parts(
        req: &mut Request,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'static>>;
}
Expand description

Trait for extracting data from request parts (without consuming the body)

Required Associated Types§

Source

type Error: IntoResponse + Send + Sync

The error type returned when extraction fails

Required Methods§

Source

fn from_request_parts( req: &mut Request, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'static>>

Extract data from 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§