pub struct RouteMatcher { /* private fields */ }Expand description
Pattern-based route matcher.
Implementations§
Source§impl RouteMatcher
impl RouteMatcher
Sourcepub fn add(&mut self, pattern: &str) -> &mut Self
pub fn add(&mut self, pattern: &str) -> &mut Self
Add a route pattern.
Patterns support:
- Static segments:
/users/list - Path parameters:
/users/:id - Wildcards:
/files/*
Sourcepub fn match_path(&self, path: &str) -> Option<RouteMatch>
pub fn match_path(&self, path: &str) -> Option<RouteMatch>
Match a path against registered routes.
Trait Implementations§
Source§impl Clone for RouteMatcher
impl Clone for RouteMatcher
Source§fn clone(&self) -> RouteMatcher
fn clone(&self) -> RouteMatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RouteMatcher
impl Debug for RouteMatcher
Auto Trait Implementations§
impl Freeze for RouteMatcher
impl RefUnwindSafe for RouteMatcher
impl Send for RouteMatcher
impl Sync for RouteMatcher
impl Unpin for RouteMatcher
impl UnsafeUnpin for RouteMatcher
impl UnwindSafe for RouteMatcher
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