Trait poem_openapi::payload::Payload [−][src]
pub trait Payload: Sized {
const CONTENT_TYPE: &'static str;
fn schema_ref() -> MetaSchemaRef;
fn from_request<'life0, 'life1, 'async_trait>(
request: &'life0 Request,
body: &'life1 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self, ParseRequestError>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn register(registry: &mut Registry) { ... }
}
Expand description
Represents a payload type.
Associated Constants
const CONTENT_TYPE: &'static str
const CONTENT_TYPE: &'static str
The content type of this payload.
Required methods
fn schema_ref() -> MetaSchemaRef
fn schema_ref() -> MetaSchemaRef
Gets schema reference of this payload.
fn from_request<'life0, 'life1, 'async_trait>(
request: &'life0 Request,
body: &'life1 mut RequestBody
) -> Pin<Box<dyn Future<Output = Result<Self, ParseRequestError>> + 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, ParseRequestError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Parse the payload object from the HTTP request.