Struct RawPathParams

struct RawPathParams(_)

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 &params {
        println!("{key:?} = {value:?}");
    }
}

let app = Router::new().route("/users/{user_id}/team/{team_id}", get(users_teams_show));
# let _: Router = app;

Implementations

impl RawPathParams

fn iter(self: &Self) -> RawPathParamsIter<'_>

Get an iterator over the path parameters.

impl Debug for RawPathParams

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Freeze for RawPathParams

impl RefUnwindSafe for RawPathParams

impl Send for RawPathParams

impl Sync for RawPathParams

impl Unpin for RawPathParams

impl UnwindSafe for RawPathParams

impl<S> FromRequestParts for RawPathParams

async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, <Self as >::Rejection>

impl<S, T> FromRequest for RawPathParams

fn from_request(req: Request<Body>, state: &S) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>

impl<T> Any for RawPathParams

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for RawPathParams

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for RawPathParams

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for RawPathParams

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for RawPathParams

impl<T> Same for RawPathParams

impl<T> WithSubscriber for RawPathParams

impl<T, U> Into for RawPathParams

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for RawPathParams

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for RawPathParams

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip for RawPathParams

fn vzip(self: Self) -> V