Struct axum::extract::UrlParamsMap [−][src]
pub struct UrlParamsMap(_);
Expand description
Extractor that will get captures from the URL.
Example
use axum::prelude::*; async fn users_show(params: extract::UrlParamsMap) { let id: Option<&str> = params.get("id"); // ... } let app = route("/users/:id", get(users_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
.
Implementations
Trait Implementations
type Rejection = MissingRouteParams
type Rejection = MissingRouteParams
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 RefUnwindSafe for UrlParamsMap
impl Send for UrlParamsMap
impl Sync for UrlParamsMap
impl Unpin for UrlParamsMap
impl UnwindSafe for UrlParamsMap
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