1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use crate::*;
/// Represents a parsed and structured route pattern.
///
/// This struct wraps a vector of `RouteSegment`s, which are the individual components
/// of a URL path. It is used internally by the `RouteMatcher` to perform efficient
/// route matching against incoming requests.
RouteSegmentList,
);
/// The core routing engine responsible for matching request paths to their corresponding handlers.
///
/// The matcher categorizes route into three types for optimized performance:
/// 1. `static_route`- For exact path matches, offering the fastest lookups.
/// 2. `dynamic_route`- For paths with variable segments.
/// 3. `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 hook.