Trait viz_core::FromRequest

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

    // Required method
    fn extract<'life0, 'async_trait>(
        req: &'life0 mut Request
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
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<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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)

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(A, B, C, D, E, F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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)

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(B, C, D, E, F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(C, D, E, F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(D, E, F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(E, F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(F, G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(G, H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(H, I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(I, J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(J, K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(K, L), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<L> FromRequest for (L,)

§

type Error = Error

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<(L,), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Infallible

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

§

type Error = Infallible

source§

fn extract<'life0, 'async_trait>( req: &'life0 mut Request ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl FromRequest for CsrfToken

Available on crate feature csrf only.
§

type Error = Error

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.