Skip to main content

OptionalFromRequestBody

Trait OptionalFromRequestBody 

pub trait OptionalFromRequestBody: OptionalFromRequest {
    // Required method
    fn from_optional_request_body(
        parts: &Parts,
        body: Body,
    ) -> impl Future<Output = Result<Option<Self>, Self::Rejection>> + Send + 'static;
}
Available on crate features http and std only.
Expand description

Customize the behavior of Option<Self> as a FromRequestBody extractor.

Required Methods§

fn from_optional_request_body( parts: &Parts, body: Body, ) -> impl Future<Output = Result<Option<Self>, Self::Rejection>> + Send + 'static

Perform extraction using borrowed request parts and an owned request body.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§