Trait FromParts

Source
pub trait FromParts<Protocol>: Sized {
    type Rejection: IntoResponse<Protocol>;

    // Required method
    fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>;
}
Expand description

Provides a protocol aware extraction from a Request. This borrows the Parts, in contrast to FromRequest which consumes the entire http::Request including the body.

Required Associated Types§

Source

type Rejection: IntoResponse<Protocol>

The type of the extraction failures.

Required Methods§

Source

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Extracts self from a Parts synchronously.

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.

Implementations on Foreign Types§

Source§

impl<P> FromParts<P> for ()

Source§

type Rejection = Infallible

Source§

fn from_parts(_parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B> FromParts<P> for (A, B)
where A: FromParts<P>, B: FromParts<P>,

Source§

type Rejection = Two<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C> FromParts<P> for (A, B, C)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>,

Source§

type Rejection = Three<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C, D> FromParts<P> for (A, B, C, D)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>, D: FromParts<P>,

Source§

type Rejection = Four<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection, <D as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C, D, E> FromParts<P> for (A, B, C, D, E)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>, D: FromParts<P>, E: FromParts<P>,

Source§

type Rejection = Five<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection, <D as FromParts<P>>::Rejection, <E as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C, D, E, F> FromParts<P> for (A, B, C, D, E, F)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>, D: FromParts<P>, E: FromParts<P>, F: FromParts<P>,

Source§

type Rejection = Six<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection, <D as FromParts<P>>::Rejection, <E as FromParts<P>>::Rejection, <F as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C, D, E, F, G> FromParts<P> for (A, B, C, D, E, F, G)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>, D: FromParts<P>, E: FromParts<P>, F: FromParts<P>, G: FromParts<P>,

Source§

type Rejection = Seven<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection, <D as FromParts<P>>::Rejection, <E as FromParts<P>>::Rejection, <F as FromParts<P>>::Rejection, <G as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, A, B, C, D, E, F, G, H> FromParts<P> for (A, B, C, D, E, F, G, H)
where A: FromParts<P>, B: FromParts<P>, C: FromParts<P>, D: FromParts<P>, E: FromParts<P>, F: FromParts<P>, G: FromParts<P>, H: FromParts<P>,

Source§

type Rejection = Eight<<A as FromParts<P>>::Rejection, <B as FromParts<P>>::Rejection, <C as FromParts<P>>::Rejection, <D as FromParts<P>>::Rejection, <E as FromParts<P>>::Rejection, <F as FromParts<P>>::Rejection, <G as FromParts<P>>::Rejection, <H as FromParts<P>>::Rejection>

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Source§

impl<P, T> FromParts<P> for Option<T>
where T: FromParts<P>,

Source§

impl<P, T> FromParts<P> for Result<T, T::Rejection>
where T: FromParts<P>,

Source§

impl<P, T> FromParts<P> for (T,)
where T: FromParts<P>,

Source§

type Rejection = <T as FromParts<P>>::Rejection

Source§

fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>

Implementors§

Source§

impl<P> FromParts<P> for ApiGatewayProxyRequestContext

Available on crate feature aws-lambda only.
Source§

impl<P> FromParts<P> for ApiGatewayV2httpRequestContext

Available on crate feature aws-lambda only.
Source§

impl<P> FromParts<P> for Context

Available on crate feature aws-lambda only.
Source§

impl<P> FromParts<P> for ServerRequestId

Available on crate feature request-id only.
Source§

impl<P, T> FromParts<P> for ConnectInfo<T>
where T: Send + Sync + 'static,

Source§

impl<Protocol, T> FromParts<Protocol> for Extension<T>
where T: Send + Sync + 'static,