Struct axum::extract::RawPathParams
source · [−]pub struct RawPathParams(_);
Expand description
Extractor that will get captures from the URL without deserializing them.
In general you should prefer to use Path
as it is higher level, however RawPathParams
is
suitable if just want the raw params without deserializing them and thus saving some
allocations.
Any percent encoded parameters will be automatically decoded. The decoded parameters must be
valid UTF-8, otherwise RawPathParams
will fail and return a 400 Bad Request
response.
Example
use axum::{
extract::RawPathParams,
routing::get,
Router,
};
async fn users_teams_show(params: RawPathParams) {
for (key, value) in ¶ms {
println!("{key:?} = {value:?}");
}
}
let app = Router::new().route("/users/:user_id/team/:team_id", get(users_teams_show));
Implementations
sourceimpl RawPathParams
impl RawPathParams
sourcepub fn iter(&self) -> RawPathParamsIter<'_>ⓘNotable traits for RawPathParamsIter<'a>impl<'a> Iterator for RawPathParamsIter<'a> type Item = (&'a str, &'a str);
pub fn iter(&self) -> RawPathParamsIter<'_>ⓘNotable traits for RawPathParamsIter<'a>impl<'a> Iterator for RawPathParamsIter<'a> type Item = (&'a str, &'a str);
Get an iterator over the path parameters.
Trait Implementations
sourceimpl Debug for RawPathParams
impl Debug for RawPathParams
sourceimpl<S> FromRequestParts<S> for RawPathParamswhere
S: Send + Sync,
impl<S> FromRequestParts<S> for RawPathParamswhere
S: Send + Sync,
type Rejection = RawPathParamsRejection
type Rejection = RawPathParamsRejection
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
sourceimpl<'a> IntoIterator for &'a RawPathParams
impl<'a> IntoIterator for &'a RawPathParams
Auto Trait Implementations
impl RefUnwindSafe for RawPathParams
impl Send for RawPathParams
impl Sync for RawPathParams
impl Unpin for RawPathParams
impl UnwindSafe for RawPathParams
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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
type Rejection = <T as FromRequestParts<S>>::Rejection
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