pub trait ParsePayload: Sized {
const IS_REQUIRED: bool;
// Required method
fn from_request(
request: &Request,
body: &mut RequestBody,
) -> impl Future<Output = Result<Self>> + Send;
}
Expand description
Represents a payload that can parse from HTTP request.
Required Associated Constants§
Sourceconst IS_REQUIRED: bool
const IS_REQUIRED: bool
If it is true
, it means that this payload is required.
Required Methods§
Sourcefn from_request(
request: &Request,
body: &mut RequestBody,
) -> impl Future<Output = Result<Self>> + Send
fn from_request( request: &Request, body: &mut RequestBody, ) -> impl Future<Output = Result<Self>> + Send
Parse the payload object from the HTTP request.
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.