pub struct RouteMatcher { /* private fields */ }
Expand description
High-performance route matcher
Implementations§
Source§impl RouteMatcher
impl RouteMatcher
Sourcepub fn add_route(
&mut self,
definition: RouteDefinition,
) -> Result<(), RouteMatchError>
pub fn add_route( &mut self, definition: RouteDefinition, ) -> Result<(), RouteMatchError>
Add a route to the matcher
Sourcepub fn resolve(&self, method: &HttpMethod, path: &str) -> Option<RouteMatch>
pub fn resolve(&self, method: &HttpMethod, path: &str) -> Option<RouteMatch>
Resolve an incoming request to a matching route
Sourcepub fn all_routes(&self) -> &HashMap<RouteId, RouteDefinition>
pub fn all_routes(&self) -> &HashMap<RouteId, RouteDefinition>
Get all route definitions for introspection
Sourcepub fn get_route(&self, route_id: &RouteId) -> Option<&RouteDefinition>
pub fn get_route(&self, route_id: &RouteId) -> Option<&RouteDefinition>
Get a specific route definition
Sourcepub fn stats(&self) -> MatcherStats
pub fn stats(&self) -> MatcherStats
Get statistics about the matcher
Trait Implementations§
Source§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 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