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
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; }
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<'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.

Implementors§