FromRequest

Trait FromRequest 

Source
pub trait FromRequest: Sized {
    type Error: IntoResponse;

    // Required method
    fn extract(
        req: &mut Request,
    ) -> 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, ) -> impl Future<Output = Result<Self, Self::Error>> + Send

Extracts this type from the HTTP Request.

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 FromRequest for ()

Source§

type Error = Error

Source§

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

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§

type Error = Error

Source§

async fn extract(req: &mut Request) -> Result<(I, J, K, L), Self::Error>

Source§

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

Source§

type Error = Error

Source§

async fn extract(req: &mut Request) -> Result<(J, K, L), Self::Error>

Source§

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

Source§

type Error = Error

Source§

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

Source§

impl<L> FromRequest for (L,)

Source§

type Error = Error

Source§

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

Source§

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

Source§

type Error = Infallible

Source§

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

Source§

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

Source§

type Error = Infallible

Source§

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

Implementors§

Source§

impl FromRequest for CsrfToken

Available on crate feature csrf only.
Source§

impl FromRequest for Cookies

Available on crate feature cookie only.
Source§

impl FromRequest for Limits

Available on crate feature limits only.
Source§

impl FromRequest for Session

Available on crate feature session only.
Source§

impl FromRequest for WebSocket

Available on crate feature websocket only.
Source§

impl FromRequest for Multipart

Available on crate feature multipart only.
Source§

impl<T> FromRequest for Form<T>

Available on crate feature form only.
Source§

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

Source§

impl<T> FromRequest for Json<T>

Available on crate feature json only.
Source§

impl<T> FromRequest for Params<T>

Available on crate feature params only.
Source§

impl<T> FromRequest for Query<T>

Available on crate feature query only.
Source§

impl<T> FromRequest for State<T>
where T: Clone + Send + Sync + 'static,

Available on crate feature state only.