pub struct PathTemplate(/* private fields */);Expand description
The original path template before parameter substitution.
This is stored in request extensions to allow middleware to access
the template pattern (e.g., /users/{id}) rather than the resolved
path (e.g., /users/123).
§Example
ⓘ
// In middleware
if let Some(template) = request.extensions().get::<PathTemplate>() {
println!("Path template: {}", template.as_str());
}Implementations§
Trait Implementations§
Source§impl AsRef<str> for PathTemplate
impl AsRef<str> for PathTemplate
Source§impl Clone for PathTemplate
impl Clone for PathTemplate
Source§fn clone(&self) -> PathTemplate
fn clone(&self) -> PathTemplate
Returns a duplicate 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 PathTemplate
impl Debug for PathTemplate
Source§impl Display for PathTemplate
impl Display for PathTemplate
Source§impl Hash for PathTemplate
impl Hash for PathTemplate
Source§impl PartialEq for PathTemplate
impl PartialEq for PathTemplate
impl Eq for PathTemplate
impl StructuralPartialEq for PathTemplate
Auto Trait Implementations§
impl Freeze for PathTemplate
impl RefUnwindSafe for PathTemplate
impl Send for PathTemplate
impl Sync for PathTemplate
impl Unpin for PathTemplate
impl UnwindSafe for PathTemplate
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.