pub struct RawPathParams(/* private fields */);
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§
Source§impl RawPathParams
impl RawPathParams
Sourcepub fn iter(&self) -> RawPathParamsIter<'_> ⓘ
pub fn iter(&self) -> RawPathParamsIter<'_> ⓘ
Get an iterator over the path parameters.
Trait Implementations§
Source§impl Debug for RawPathParams
impl Debug for RawPathParams
Source§impl<S> FromRequestParts<S> for RawPathParams
impl<S> FromRequestParts<S> for RawPathParams
Source§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.
Source§impl<'a> IntoIterator for &'a RawPathParams
impl<'a> IntoIterator for &'a RawPathParams
Auto Trait Implementations§
impl Freeze for RawPathParams
impl RefUnwindSafe for RawPathParams
impl Send for RawPathParams
impl Sync for RawPathParams
impl Unpin for RawPathParams
impl UnwindSafe for RawPathParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§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.
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes