Struct MatchedPath
struct MatchedPath(_)
Access the path in the router that matches the request.
use ;
let app = new.route;
# let _: Router = app;
Accessing MatchedPath via extensions
MatchedPath can also be accessed from middleware via request extensions.
This is useful for example with Trace to
create a span that contains the matched path:
use ;
use TraceLayer;
let app = new
.route
.layer;
# let _: Router = app;
Implementations
impl MatchedPath
fn as_str(self: &Self) -> &strReturns a
strrepresentation of the path.
impl Clone for MatchedPath
fn clone(self: &Self) -> MatchedPath
impl Debug for MatchedPath
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Freeze for MatchedPath
impl RefUnwindSafe for MatchedPath
impl Send for MatchedPath
impl Sync for MatchedPath
impl Unpin for MatchedPath
impl UnsafeUnpin for MatchedPath
impl UnwindSafe for MatchedPath
impl<S> FromRequestParts for MatchedPath
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Self, <Self as >::Rejection>
impl<S> OptionalFromRequestParts for MatchedPath
async fn from_request_parts(parts: &mut Parts, _state: &S) -> Result<Option<Self>, <Self as >::Rejection>
impl<S, T> FromRequest for MatchedPath
fn from_request(req: Request<Body>, state: &S) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
impl<T> Any for MatchedPath
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for MatchedPath
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for MatchedPath
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for MatchedPath
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for MatchedPath
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FromRef for MatchedPath
fn from_ref(input: &T) -> T
impl<T> Instrument for MatchedPath
impl<T> Same for MatchedPath
impl<T> ToOwned for MatchedPath
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> WithSubscriber for MatchedPath
impl<T, U> Into for MatchedPath
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for MatchedPath
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for MatchedPath
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<V, T> VZip for MatchedPath
fn vzip(self: Self) -> V