pub struct RouteMatcher { /* private fields */ }Expand description
The core routing engine responsible for matching request paths to their corresponding handlers.
The matcher categorizes route into three types for optimized performance:
static_route- For exact path matches, offering the fastest lookups.dynamic_route- For paths with variable segments.regex_route- For complex matching based on regular expressions.
When a request comes in, the matcher checks these categories in order to find the appropriate handler.
Implementations§
Source§impl RouteMatcher
impl RouteMatcher
pub fn get_static_route(&self) -> &ServerHookMap
pub fn get_dynamic_route(&self) -> &ServerHookPatternRoute
pub fn get_regex_route(&self) -> &ServerHookPatternRoute
pub fn get_ac_automaton(&self) -> &Option<RouteSearchEngine>
pub fn get_ac_pattern_map( &self, ) -> &HashMapXxHash3_64<usize, (usize, usize, bool)>
Source§impl RouteMatcher
impl RouteMatcher
pub fn get_mut_ac_automaton(&mut self) -> &mut Option<RouteSearchEngine>
pub fn get_mut_ac_pattern_map( &mut self, ) -> &mut HashMapXxHash3_64<usize, (usize, usize, bool)>
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 · 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
Source§impl Default for RouteMatcher
Provides a default implementation for RouteMatcher.
impl Default for RouteMatcher
Provides a default implementation for RouteMatcher.
Source§impl Display for RouteMatcher
impl Display for RouteMatcher
Source§impl PartialEq for RouteMatcher
Implements the PartialEq trait for RouteMatcher.
impl PartialEq for RouteMatcher
Implements the PartialEq trait for RouteMatcher.
This allows for comparing two RouteMatcher instances for equality.
impl Eq for RouteMatcher
Implements the Eq trait for RouteMatcher.
This indicates that RouteMatcher has a total equality relation.
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