Skip to main content

FromRequestParts

Trait FromRequestParts 

Source
pub trait FromRequestParts: Sized {
    type Rejection: Into<OxiHttpError>;

    // Required method
    fn from_request_parts(
        parts: &RequestParts<'_>,
    ) -> Result<Self, Self::Rejection>;
}
Expand description

Trait for types that can be extracted from RequestParts.

Implement this trait to create custom extractors that can be used with Request::extract.

Required Associated Types§

Source

type Rejection: Into<OxiHttpError>

The error type returned when extraction fails.

Required Methods§

Source

fn from_request_parts(parts: &RequestParts<'_>) -> Result<Self, Self::Rejection>

Attempt to extract Self from the request parts.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§