pub trait FromRequestParts: Sized {
type Error: Respondable;
// Required method
fn from_request_parts(req: &mut Parts) -> Result<Self, Self::Error>;
}
Expand description
Types that can be created from request parts.
Extractors that implement FromRequestParts
cannot consume the request body and can thus be
run in any order for handlers.
If your extractor needs to consume the request body then you should implement FromRequest
and not FromRequestParts
.
Required Associated Types§
type Error: Respondable
Required Methods§
fn from_request_parts(req: &mut Parts) -> Result<Self, Self::Error>
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.