Trait FromRequestBody
pub trait FromRequestBody: FromRequest {
// Required method
fn from_request_body(
parts: &Parts,
body: Body,
) -> impl Future<Output = Result<Self, Self::Rejection>> + Send + 'static;
}Available on crate features
http and std only.Expand description
Types that own the request body while only borrowing the other request parts.
This is the body-only counterpart to FromRequest. It enables an immediately preceding
FromOwnedRequestParts extractor to take ownership of the request parts after the body
extractor has finished inspecting them. Types implementing this trait also implement
FromRequest so they remain usable as ordinary terminal extractors.
Required Methods§
fn from_request_body(
parts: &Parts,
body: Body,
) -> impl Future<Output = Result<Self, Self::Rejection>> + Send + 'static
fn from_request_body( parts: &Parts, body: Body, ) -> impl Future<Output = Result<Self, Self::Rejection>> + Send + 'static
Prepare extraction using borrowed request parts and an owned request body.
The returned future cannot borrow parts, allowing the request parts to be dropped or
moved before body processing is awaited.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".