Trait axum::extract::FromRequest
source · [−]pub trait FromRequest<B> {
type Rejection: IntoResponse;
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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.
See axum::extract
for more details.
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, RequestParts},
};
struct MyExtractor;
#[async_trait]
impl<B> FromRequest<B> for MyExtractor
where
B: Send, // required by `async_trait`
{
type Rejection = http::StatusCode;
async fn from_request(req: &mut RequestParts<B>) -> 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
sourcefn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
Implementations on Foreign Types
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7), <(T1, T2, T3, T4, T5, T6, T7) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7): 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
T15: FromRequest<B> + Send,
T16: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
T15: FromRequest<B> + Send,
T16: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::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<T, B> FromRequest<B> for Option<T>where
T: FromRequest<B>,
B: Send,
impl<T, B> FromRequest<B> for Option<T>where
T: FromRequest<B>,
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Option<T>, <Option<T> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Option<T>: 'async_trait,
sourceimpl<B> FromRequest<B> for Methodwhere
B: Send,
impl<B> FromRequest<B> for Methodwhere
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Method, <Method as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Method: 'async_trait,
sourceimpl<B> FromRequest<B> for Uriwhere
B: Send,
impl<B> FromRequest<B> for Uriwhere
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Uri, <Uri as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Uri: 'async_trait,
sourceimpl<B> FromRequest<B> for Partswhere
B: Send,
impl<B> FromRequest<B> for Partswhere
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Parts, <Parts as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Parts: 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12): 'async_trait,
sourceimpl<T, B> FromRequest<B> for Result<T, <T as FromRequest<B>>::Rejection>where
T: FromRequest<B>,
B: Send,
impl<T, B> FromRequest<B> for Result<T, <T as FromRequest<B>>::Rejection>where
T: FromRequest<B>,
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Result<T, <T as FromRequest<B>>::Rejection>, <Result<T, <T as FromRequest<B>>::Rejection> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Result<T, <T as FromRequest<B>>::Rejection>: 'async_trait,
sourceimpl<B> FromRequest<B> for ()where
B: Send,
impl<B> FromRequest<B> for ()where
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
__arg0: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(), <() as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(): 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::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<B> FromRequest<B> for Versionwhere
B: Send,
impl<B> FromRequest<B> for Versionwhere
B: Send,
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Version, <Version as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Version: 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6> FromRequest<B> for (T1, T2, T3, T4, T5, T6)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6> FromRequest<B> for (T1, T2, T3, T4, T5, T6)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6), <(T1, T2, T3, T4, T5, T6) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6): 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5> FromRequest<B> for (T1, T2, T3, T4, T5)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5> FromRequest<B> for (T1, T2, T3, T4, T5)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5), <(T1, T2, T3, T4, T5) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5): 'async_trait,
sourceimpl<B> FromRequest<B> for Byteswhere
B: Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<B> FromRequest<B> for Byteswhere
B: Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Rejection = BytesRejection
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Bytes, <Bytes as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Bytes: 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4, T5, T6, T7, T8), <(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8): 'async_trait,
sourceimpl<B, T1, T2> FromRequest<B> for (T1, T2)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2> FromRequest<B> for (T1, T2)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2), <(T1, T2) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2): 'async_trait,
sourceimpl<B, T1, T2, T3> FromRequest<B> for (T1, T2, T3)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3> FromRequest<B> for (T1, T2, T3)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3), <(T1, T2, T3) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3): 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9): 'async_trait,
sourceimpl<B> FromRequest<B> for Stringwhere
B: Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
impl<B> FromRequest<B> for Stringwhere
B: Body + Send,
<B as Body>::Data: Send,
<B as Body>::Error: Into<Box<dyn Error + Sync + Send + 'static, Global>>,
type Rejection = StringRejection
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<String, <String as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
String: 'async_trait,
sourceimpl<B> FromRequest<B> for Request<B>where
B: Send,
impl<B> FromRequest<B> for Request<B>where
B: Send,
type Rejection = BodyAlreadyExtracted
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Request<B>, <Request<B> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Request<B>: 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
T15: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
T15: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::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<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
T12: FromRequest<B> + Send,
T13: FromRequest<B> + Send,
T14: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::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<B, T1, T2, T3, T4> FromRequest<B> for (T1, T2, T3, T4)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4> FromRequest<B> for (T1, T2, T3, T4)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1, T2, T3, T4), <(T1, T2, T3, T4) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4): 'async_trait,
sourceimpl<B, T1> FromRequest<B> for (T1,)where
T1: FromRequest<B> + Send,
B: Send,
impl<B, T1> FromRequest<B> for (T1,)where
T1: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<(T1,), <(T1,) as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1,): 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
T11: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11): 'async_trait,
sourceimpl<B> FromRequest<B> for HeaderMap<HeaderValue>where
B: Send,
impl<B> FromRequest<B> for HeaderMap<HeaderValue>where
B: Send,
Clone the headers from the request.
Prefer using TypedHeader
to extract only the headers you need.
type Rejection = Infallible
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<HeaderMap<HeaderValue>, <HeaderMap<HeaderValue> as FromRequest<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
HeaderMap<HeaderValue>: 'async_trait,
sourceimpl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromRequest<B> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)where
T1: FromRequest<B> + Send,
T2: FromRequest<B> + Send,
T3: FromRequest<B> + Send,
T4: FromRequest<B> + Send,
T5: FromRequest<B> + Send,
T6: FromRequest<B> + Send,
T7: FromRequest<B> + Send,
T8: FromRequest<B> + Send,
T9: FromRequest<B> + Send,
T10: FromRequest<B> + Send,
B: Send,
type Rejection = Response<UnsyncBoxBody<Bytes, Error>>
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> 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<B>>::Rejection>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10): 'async_trait,
Implementors
sourceimpl<B> FromRequest<B> for BodyStreamwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
impl<B> FromRequest<B> for BodyStreamwhere
B: HttpBody + Send + 'static,
B::Data: Into<Bytes>,
B::Error: Into<BoxError>,
type Rejection = BodyAlreadyExtracted
sourceimpl<B> FromRequest<B> for Hostwhere
B: Send,
impl<B> FromRequest<B> for Hostwhere
B: Send,
type Rejection = HostRejection
sourceimpl<B> FromRequest<B> for MatchedPathwhere
B: Send,
Available on crate feature matched-path
only.
impl<B> FromRequest<B> for MatchedPathwhere
B: Send,
matched-path
only.type Rejection = MatchedPathRejection
sourceimpl<B> FromRequest<B> for Multipartwhere
B: HttpBody<Data = Bytes> + Default + Unpin + Send + 'static,
B::Error: Into<BoxError>,
Available on crate feature multipart
only.
impl<B> FromRequest<B> for Multipartwhere
B: HttpBody<Data = Bytes> + Default + Unpin + Send + 'static,
B::Error: Into<BoxError>,
multipart
only.type Rejection = MultipartRejection
sourceimpl<B> FromRequest<B> for OriginalUriwhere
B: Send,
Available on crate feature original-uri
only.
impl<B> FromRequest<B> for OriginalUriwhere
B: Send,
original-uri
only.type Rejection = Infallible
sourceimpl<B> FromRequest<B> for RawBody<B>where
B: Send,
impl<B> FromRequest<B> for RawBody<B>where
B: Send,
type Rejection = BodyAlreadyExtracted
sourceimpl<B> FromRequest<B> for RawQuerywhere
B: Send,
impl<B> FromRequest<B> for RawQuerywhere
B: Send,
type Rejection = Infallible
sourceimpl<B> FromRequest<B> for WebSocketUpgradewhere
B: Send,
Available on crate feature ws
only.
impl<B> FromRequest<B> for WebSocketUpgradewhere
B: Send,
ws
only.sourceimpl<B, T> FromRequest<B> for ConnectInfo<T>where
B: Send,
T: Clone + Send + Sync + 'static,
impl<B, T> FromRequest<B> for ConnectInfo<T>where
B: Send,
T: Clone + Send + Sync + 'static,
type Rejection = <Extension<ConnectInfo<T>> as FromRequest<B>>::Rejection
sourceimpl<T, B> FromRequest<B> for Extension<T>where
T: Clone + Send + Sync + 'static,
B: Send,
impl<T, B> FromRequest<B> for Extension<T>where
T: Clone + Send + Sync + 'static,
B: Send,
type Rejection = ExtensionRejection
sourceimpl<T, B> FromRequest<B> for Form<T>where
T: DeserializeOwned,
B: HttpBody + Send,
B::Data: Send,
B::Error: Into<BoxError>,
Available on crate feature form
only.
impl<T, B> FromRequest<B> for Form<T>where
T: DeserializeOwned,
B: HttpBody + Send,
B::Data: Send,
B::Error: Into<BoxError>,
form
only.type Rejection = FormRejection
sourceimpl<T, B> FromRequest<B> for Json<T>where
T: DeserializeOwned,
B: HttpBody + Send,
B::Data: Send,
B::Error: Into<BoxError>,
Available on crate feature json
only.
impl<T, B> FromRequest<B> for Json<T>where
T: DeserializeOwned,
B: HttpBody + Send,
B::Data: Send,
B::Error: Into<BoxError>,
json
only.type Rejection = JsonRejection
sourceimpl<T, B> FromRequest<B> for TypedHeader<T>where
T: Header,
B: Send,
Available on crate feature headers
only.
impl<T, B> FromRequest<B> for TypedHeader<T>where
T: Header,
B: Send,
headers
only.type Rejection = TypedHeaderRejection
sourceimpl<T, B> FromRequest<B> for Path<T>where
T: DeserializeOwned + Send,
B: Send,
impl<T, B> FromRequest<B> for Path<T>where
T: DeserializeOwned + Send,
B: Send,
type Rejection = PathRejection
sourceimpl<T, B> FromRequest<B> for Query<T>where
T: DeserializeOwned,
B: Send,
Available on crate feature query
only.
impl<T, B> FromRequest<B> for Query<T>where
T: DeserializeOwned,
B: Send,
query
only.