FromRequest

Trait FromRequest 

Source
pub trait FromRequest<'a, M = ViaRequest>: Sized {
    type Error: ResponseError;

    // Required method
    fn from_request(
        head: &'a mut Head,
        body: RequestBody,
    ) -> impl Future<Output = Result<Self, Self::Error>> + Send;
}

Required Associated Types§

Required Methods§

Source

fn from_request( head: &'a mut Head, body: RequestBody, ) -> impl Future<Output = Result<Self, Self::Error>> + Send

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.

Implementations on Foreign Types§

Source§

impl<'a> FromRequest<'a> for String

Source§

type Error = ReadStringError

Source§

async fn from_request( head: &'a mut Head, body: RequestBody, ) -> Result<Self, Self::Error>

Source§

impl<'a> FromRequest<'a> for Vec<u8>

Source§

type Error = ReadBytesError

Source§

async fn from_request( head: &'a mut Head, body: RequestBody, ) -> Result<Self, Self::Error>

Source§

impl<'a> FromRequest<'a> for Bytes

Source§

type Error = ReadBytesError

Source§

async fn from_request( head: &'a mut Head, body: RequestBody, ) -> Result<Self, Self::Error>

Source§

impl<'a, T: FromRequest<'a>> FromRequest<'a> for Option<T>

Source§

type Error = Infallible

Source§

async fn from_request( head: &'a mut Head, body: RequestBody, ) -> Result<Self, Self::Error>

Source§

impl<'a, T: FromRequest<'a>> FromRequest<'a> for Result<T, T::Error>

Source§

type Error = Infallible

Source§

async fn from_request( head: &'a mut Head, body: RequestBody, ) -> Result<Self, Self::Error>

Implementors§