Struct axum::extract::UrlParams [−][src]
pub struct UrlParams<T>(pub T);
Expand description
Extractor that will get captures from the URL and parse them.
Example
use axum::{extract::UrlParams, prelude::*}; use uuid::Uuid; async fn users_teams_show( UrlParams(params): UrlParams<(Uuid, Uuid)>, ) { let user_id: Uuid = params.0; let team_id: Uuid = params.1; // ... } let app = route("/users/:user_id/team/:team_id", get(users_teams_show));
Note that you can only have one URL params extractor per handler. If you
have multiple it’ll response with 500 Internal Server Error
.
Tuple Fields
0: T
Trait Implementations
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T1: FromStr + Send,
T2: FromStr + Send,
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T1: FromStr + Send,
T2: FromStr + Send,
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T2: FromStr + Send,
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T2: FromStr + Send,
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T3: FromStr + Send,
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T4: FromStr + Send,
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T5: FromStr + Send,
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T6: FromStr + Send,
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T7: FromStr + Send,
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<B, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
impl<B, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromRequest<B> for UrlParams<(T8, T9, T10, T11, T12, T13, T14, T15, T16)> where
T8: FromStr + Send,
T9: FromStr + Send,
T10: FromStr + Send,
T11: FromStr + Send,
T12: FromStr + Send,
T13: FromStr + Send,
T14: FromStr + Send,
T15: FromStr + Send,
T16: FromStr + Send,
B: Send,
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
type Rejection = UrlParamsRejection
type Rejection = UrlParamsRejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
Auto Trait Implementations
impl<T> RefUnwindSafe for UrlParams<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for UrlParams<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Create a new Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more
type Output = T
type Output = T
Should always be Self