Trait poem_openapi::payload::ParsePayload
source · pub trait ParsePayload: Sized {
const IS_REQUIRED: bool;
// Required method
fn from_request<'life0, 'life1, 'async_trait>(
request: &'life0 Request,
body: &'life1 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
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<'life0, 'life1, 'async_trait>(
request: &'life0 Request,
body: &'life1 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn from_request<'life0, 'life1, 'async_trait>( request: &'life0 Request, body: &'life1 mut RequestBody ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Parse the payload object from the HTTP request.