poem_openapi::payload

Trait ParsePayload

Source
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§

Source

const IS_REQUIRED: bool

If it is true, it means that this payload is required.

Required Methods§

Source

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.

Implementors§