Struct pavex::request::path::MatchedPathPattern
source · pub struct MatchedPathPattern(/* private fields */);
Expand description
The route template that matched for the incoming request.
§Example
If you configure your Blueprint
like this:
use pavex::{f, blueprint::{Blueprint, router::GET}};
bp.route(GET, "/home/:home_id", f!(crate::get_home));
Then MatchedPathPattern
will be set to /home/:home_id
for a GET /home/123
request.
§Framework primitive
MatchedPathPattern
is a framework primitive—you don’t need to register any constructor
with Blueprint
to use it in your application.
§Use cases
The primary use case for MatchedPathPattern
is telemetry—logging, metrics, etc.
It lets you strip away the dynamic parts of the request path, thus reducing the cardinality of
your metrics and making it easier to aggregate them.
Implementations§
Trait Implementations§
source§impl Clone for MatchedPathPattern
impl Clone for MatchedPathPattern
source§fn clone(&self) -> MatchedPathPattern
fn clone(&self) -> MatchedPathPattern
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MatchedPathPattern
impl Debug for MatchedPathPattern
source§impl Display for MatchedPathPattern
impl Display for MatchedPathPattern
impl Copy for MatchedPathPattern
Auto Trait Implementations§
impl Freeze for MatchedPathPattern
impl RefUnwindSafe for MatchedPathPattern
impl Send for MatchedPathPattern
impl Sync for MatchedPathPattern
impl Unpin for MatchedPathPattern
impl UnwindSafe for MatchedPathPattern
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)