You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The literal characters `{` and `}` may be included in a static route by escaping them with the same character. For example, the `{` character is escaped with `{{` and the `}` character is escaped with `}}`.
//! The router takes advantage of the fact that URL routes generally follow a hierarchical structure. Routes are stored them in a radix trie that makes heavy use of common prefixes:
109
-
//!
110
-
//! ```text
111
-
//! Priority Path Value
112
-
//! 9 \ 1
113
-
//! 3 ├s None
114
-
//! 2 |├earch\ 2
115
-
//! 1 |└upport\ 3
116
-
//! 2 ├blog\ 4
117
-
//! 1 | └{post} None
118
-
//! 1 | └\ 5
119
-
//! 2 ├about-us\ 6
120
-
//! 1 | └team\ 7
121
-
//! 1 └contact\ 8
122
-
//! ```
123
-
//!
124
-
//! This allows us to reduce the route search to a small number of branches. Child nodes on the same level of the tree are also prioritized
125
-
//! by the number of children with registered values, increasing the chance of choosing the correct branch of the first try.
The literal characters `{` and `}` may be included in a static route by escaping them with the same character. For example, the `{` character is escaped with `{{` and the `}` character is escaped with `}}`.
The router takes advantage of the fact that URL routes generally follow a hierarchical structure. Routes are stored them in a radix trie that makes heavy use of common prefixes.
93
+
94
+
```text
95
+
Priority Path Value
96
+
9 \ 1
97
+
3 ├s None
98
+
2 |├earch\ 2
99
+
1 |└upport\ 3
100
+
2 ├blog\ 4
101
+
1 | └{post} None
102
+
1 | └\ 5
103
+
2 ├about-us\ 6
104
+
1 | └team\ 7
105
+
1 └contact\ 8
106
+
```
107
+
108
+
This allows us to reduce the route search to a small number of branches. Child nodes on the same level of the tree are also prioritized
109
+
by the number of children with registered values, increasing the chance of choosing the correct branch of the first try.
110
+
111
+
As it turns out, this method of routing is extremely fast. See the [benchmark results](https://github.com/ibraheemdev/matchit?tab=readme-ov-file#benchmarks) for details.
112
+
*/
113
+
126
114
#![deny(rust_2018_idioms, clippy::all)]
127
115
128
116
mod error;
@@ -136,13 +124,8 @@ pub use params::{Params, ParamsIter};
0 commit comments