Trait viz::FromRequest

source ·
pub trait FromRequest: Sized {
    type Error: IntoResponse;

    // Required method
    fn extract(
        req: &mut Request<Body>
    ) -> impl Future<Output = Result<Self, Self::Error>> + Send;
}
Expand description

An interface for extracting data from the HTTP Request.

Required Associated Types§

source

type Error: IntoResponse

The type returned in the event of a conversion error.

Required Methods§

source

fn extract( req: &mut Request<Body> ) -> impl Future<Output = Result<Self, Self::Error>> + Send

Extracts this type from the HTTP Request.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromRequest for ()

§

type Error = Error

source§

async fn extract( req: &mut Request<Body> ) -> Result<(), <() as FromRequest>::Error>

source§

impl FromRequest for FormData<Body>

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> FromRequest for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<B, C, D, E, F, G, H, I, J, K, L> FromRequest for (B, C, D, E, F, G, H, I, J, K, L)

source§

impl<C, D, E, F, G, H, I, J, K, L> FromRequest for (C, D, E, F, G, H, I, J, K, L)

source§

impl<D, E, F, G, H, I, J, K, L> FromRequest for (D, E, F, G, H, I, J, K, L)

source§

impl<E, F, G, H, I, J, K, L> FromRequest for (E, F, G, H, I, J, K, L)

source§

impl<F, G, H, I, J, K, L> FromRequest for (F, G, H, I, J, K, L)

source§

impl<G, H, I, J, K, L> FromRequest for (G, H, I, J, K, L)

source§

impl<H, I, J, K, L> FromRequest for (H, I, J, K, L)

source§

impl<I, J, K, L> FromRequest for (I, J, K, L)

source§

impl<J, K, L> FromRequest for (J, K, L)

source§

impl<K, L> FromRequest for (K, L)

§

type Error = Error

source§

async fn extract( req: &mut Request<Body> ) -> Result<(K, L), <(K, L) as FromRequest>::Error>

source§

impl<L> FromRequest for (L,)

§

type Error = Error

source§

async fn extract( req: &mut Request<Body> ) -> Result<(L,), <(L,) as FromRequest>::Error>

source§

impl<T> FromRequest for Option<T>
where T: FromRequest,

§

type Error = Infallible

source§

async fn extract( req: &mut Request<Body> ) -> Result<Option<T>, <Option<T> as FromRequest>::Error>

source§

impl<T> FromRequest for Result<T, <T as FromRequest>::Error>
where T: FromRequest,

§

type Error = Infallible

source§

async fn extract( req: &mut Request<Body> ) -> Result<Result<T, <T as FromRequest>::Error>, <Result<T, <T as FromRequest>::Error> as FromRequest>::Error>

Implementors§