pub trait RequestContents {
    type Content: Send + Sized + 'static;

    // Required method
    fn from_body<'async_trait>(
        body: Body
    ) -> Pin<Box<dyn Future<Output = Result<Self::Content, Status>> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

The deserializer trait for converting the request body into the desired type specified by Self::Content.

This trait is automatically implemented for the Body type and any type implementing rkyv’s (de)serializer traits.

Required Associated Types§

source

type Content: Send + Sized + 'static

The deserialized message type.

Required Methods§

source

fn from_body<'async_trait>( body: Body ) -> Pin<Box<dyn Future<Output = Result<Self::Content, Status>> + Send + 'async_trait>>where Self: 'async_trait,

Implementors§

source§

impl RequestContents for Body

source§

impl<Msg> RequestContents for Msgwhere Msg: Archive + Send + Sync + 'static, Msg::Archived: CheckBytes<DefaultValidator<'static>> + Send + Sync + 'static,