Trait axum::extract::FromRequest
source · pub trait FromRequest<S, B, M = ViaRequest>: Sized {
type Rejection: IntoResponse;
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Types that can be created from requests.
Extractors that implement FromRequest
can consume the request body and can thus only be run
once for handlers.
If your extractor doesn’t need to consume the request body then you should implement
FromRequestParts
and not FromRequest
.
See axum::extract
for more general docs about extraxtors.
What is the B
type parameter?
FromRequest
is generic over the request body (the B
in
http::Request<B>
). This is to allow FromRequest
to be usable with any
type of request body. This is necessary because some middleware change the
request body, for example to add timeouts.
If you’re writing your own FromRequest
that wont be used outside your
application, and not using any middleware that changes the request body, you
can most likely use axum::body::Body
.
If you’re writing a library that’s intended for others to use, it’s recommended to keep the generic type parameter:
use axum::{
async_trait,
extract::FromRequest,
http::Request,
};
struct MyExtractor;
#[async_trait]
impl<S, B> FromRequest<S, B> for MyExtractor
where
// these bounds are required by `async_trait`
B: Send + 'static,
S: Send + Sync,
{
type Rejection = http::StatusCode;
async fn from_request(req: Request<B>, state: &S) -> Result<Self, Self::Rejection> {
// ...
}
}
This ensures your extractor is as flexible as possible.
Required Associated Types
sourcetype Rejection: IntoResponse
type Rejection: IntoResponse
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response.
Required Methods
Implementations on Foreign Types
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequestParts<S> + Send,
T15: FromRequestParts<S> + Send,
T16: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequestParts<S> + Send,
T15: FromRequestParts<S> + Send,
T16: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11): 'async_trait,
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for Request<B>where
B: Send,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for Request<B>where
B: Send,
S: Send + Sync,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: Request<B>,
__arg1: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<Request<B>, <Request<B> as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Request<B>: 'async_trait,
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for Stringwhere
B: 'static + Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync + 'static, Global>>,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for Stringwhere
B: 'static + Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync + 'static, Global>>,
S: Send + Sync,
sourceimpl<S, T, B> FromRequest<S, B, ViaRequest> for Option<T>where
T: FromRequest<S, B, ViaRequest>,
B: 'static + Send,
S: Send + Sync,
impl<S, T, B> FromRequest<S, B, ViaRequest> for Option<T>where
T: FromRequest<S, B, ViaRequest>,
B: 'static + Send,
S: Send + Sync,
sourceimpl<S, T, B> FromRequest<S, B, ViaRequest> for Result<T, <T as FromRequest<S, B, ViaRequest>>::Rejection>where
T: FromRequest<S, B, ViaRequest>,
B: 'static + Send,
S: Send + Sync,
impl<S, T, B> FromRequest<S, B, ViaRequest> for Result<T, <T as FromRequest<S, B, ViaRequest>>::Rejection>where
T: FromRequest<S, B, ViaRequest>,
B: 'static + Send,
S: Send + Sync,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<Result<T, <T as FromRequest<S, B, ViaRequest>>::Rejection>, <Result<T, <T as FromRequest<S, B, ViaRequest>>::Rejection> as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Result<T, <T as FromRequest<S, B, ViaRequest>>::Rejection>: 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8), <(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7), <(T1, T2, T3, T4, T5, T6, T7) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5), <(T1, T2, T3, T4, T5) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequestParts<S> + Send,
T15: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequestParts<S> + Send,
T14: FromRequestParts<S> + Send,
T15: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12): 'async_trait,
sourceimpl<S, B, T1> FromRequest<S, B, ViaRequest> for (T1,)where
T1: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1> FromRequest<S, B, ViaRequest> for (T1,)where
T1: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1,), <(T1,) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1,): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9), <(T1, T2, T3, T4, T5, T6, T7, T8, T9) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9): 'async_trait,
sourceimpl<S, B, T1, T2, T3> FromRequest<S, B, ViaRequest> for (T1, T2, T3)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3> FromRequest<S, B, ViaRequest> for (T1, T2, T3)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3), <(T1, T2, T3) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequestParts<S> + Send,
T11: FromRequestParts<S> + Send,
T12: FromRequestParts<S> + Send,
T13: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4), <(T1, T2, T3, T4) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4): 'async_trait,
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for Byteswhere
B: 'static + Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync + 'static, Global>>,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for Byteswhere
B: 'static + Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Send + Sync + 'static, Global>>,
S: Send + Sync,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequestParts<S> + Send,
T7: FromRequestParts<S> + Send,
T8: FromRequestParts<S> + Send,
T9: FromRequestParts<S> + Send,
T10: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), <(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10): 'async_trait,
sourceimpl<S, B, T1, T2> FromRequest<S, B, ViaRequest> for (T1, T2)where
T1: FromRequestParts<S> + Send,
T2: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2> FromRequest<S, B, ViaRequest> for (T1, T2)where
T1: FromRequestParts<S> + Send,
T2: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2), <(T1, T2) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2): 'async_trait,
sourceimpl<S, B, T1, T2, T3, T4, T5, T6> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
impl<S, B, T1, T2, T3, T4, T5, T6> FromRequest<S, B, ViaRequest> for (T1, T2, T3, T4, T5, T6)where
T1: FromRequestParts<S> + Send,
T2: FromRequestParts<S> + Send,
T3: FromRequestParts<S> + Send,
T4: FromRequestParts<S> + Send,
T5: FromRequestParts<S> + Send,
T6: FromRequest<S, B, ViaRequest> + Send,
B: 'static + Send,
S: Send + Sync,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: Request<B>,
state: &'life0 S
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6), <(T1, T2, T3, T4, T5, T6) as FromRequest<S, B, ViaRequest>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6): 'async_trait,
Implementors
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for BodyStreamwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for BodyStreamwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
S: Send + Sync,
type Rejection = Infallible
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for Multipartwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
S: Send + Sync,
Available on crate feature multipart
only.
impl<S, B> FromRequest<S, B, ViaRequest> for Multipartwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
S: Send + Sync,
multipart
only.type Rejection = MultipartRejection
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for RawBody<B>where
B: Send,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for RawBody<B>where
B: Send,
S: Send + Sync,
type Rejection = Infallible
sourceimpl<S, B> FromRequest<S, B, ViaRequest> for RawFormwhere
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
impl<S, B> FromRequest<S, B, ViaRequest> for RawFormwhere
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
type Rejection = RawFormRejection
sourceimpl<S, B, T> FromRequest<S, B, ViaParts> for Twhere
B: 'static + Send,
S: Send + Sync,
T: FromRequestParts<S>,
impl<S, B, T> FromRequest<S, B, ViaParts> for Twhere
B: 'static + Send,
S: Send + Sync,
T: FromRequestParts<S>,
type Rejection = <T as FromRequestParts<S>>::Rejection
sourceimpl<T, S, B> FromRequest<S, B, ViaRequest> for Form<T>where
T: DeserializeOwned,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
Available on crate feature form
only.
impl<T, S, B> FromRequest<S, B, ViaRequest> for Form<T>where
T: DeserializeOwned,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
form
only.type Rejection = FormRejection
sourceimpl<T, S, B> FromRequest<S, B, ViaRequest> for Json<T>where
T: DeserializeOwned,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
Available on crate feature json
only.
impl<T, S, B> FromRequest<S, B, ViaRequest> for Json<T>where
T: DeserializeOwned,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<BoxError>,
S: Send + Sync,
json
only.