Trait poem_openapi::payload::ParsePayload
source · [−]pub trait ParsePayload: Sized {
const IS_REQUIRED: bool;
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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
Represents a payload that can parse from HTTP request.
Associated Constants
const IS_REQUIRED: bool
const IS_REQUIRED: bool
If it is true
, it means that this payload is required.
Required methods
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
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Parse the payload object from the HTTP request.