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§
Required Methods§
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 ()
impl<P> FromParts<P> for ()
type Rejection = Infallible
fn from_parts(_parts: &mut Parts) -> Result<Self, Self::Rejection>
Source§impl<P, A, B, C, D> FromParts<P> for (A, B, C, D)
impl<P, A, B, C, D> FromParts<P> for (A, B, C, D)
Source§impl<P, A, B, C, D, E> FromParts<P> for (A, B, C, D, E)
impl<P, A, B, C, D, E> FromParts<P> for (A, B, C, D, E)
Source§impl<P, A, B, C, D, E, F> FromParts<P> for (A, B, C, D, E, F)
impl<P, A, B, C, D, E, F> FromParts<P> for (A, B, C, D, E, F)
Source§impl<P, A, B, C, D, E, F, G> FromParts<P> for (A, B, C, D, E, F, G)
impl<P, A, B, C, D, E, F, G> FromParts<P> for (A, B, C, D, E, F, G)
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>
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)
impl<P, A, B, C, D, E, F, G, H> FromParts<P> for (A, B, C, D, E, F, G, H)
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>
fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>
Source§impl<P, T> FromParts<P> for Option<T>where
T: FromParts<P>,
impl<P, T> FromParts<P> for Option<T>where
T: FromParts<P>,
type Rejection = Infallible
fn from_parts(parts: &mut Parts) -> Result<Self, Self::Rejection>
Source§impl<P, T> FromParts<P> for Result<T, T::Rejection>where
T: FromParts<P>,
impl<P, T> FromParts<P> for Result<T, T::Rejection>where
T: FromParts<P>,
type Rejection = Infallible
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.
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.
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.
impl<P> FromParts<P> for Context
Available on crate feature
aws-lambda
only.type Rejection = MissingContext
Source§impl<P> FromParts<P> for ServerRequestId
Available on crate feature request-id
only.
impl<P> FromParts<P> for ServerRequestId
Available on crate feature
request-id
only.