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§
Required Methods§
fn from_body<'async_trait>(
body: Body,
) -> Pin<Box<dyn Future<Output = Result<Self::Content, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.