hyper_tree_router/
parameters.rs1use prefix_tree_map::Captures;
2use std::collections::HashMap;
3
4pub struct UrlParams {
5 pub captures: HashMap<String, String>,
6}
7
8impl UrlParams {
9 pub fn new() -> Self {
10 Self {
11 captures: HashMap::new(),
12 }
13 }
14}
15
16impl Default for UrlParams {
17 fn default() -> Self {
18 Self::new()
19 }
20}
21
22impl Captures<&str, &str> for UrlParams {
23 fn insert(&mut self, key: &str, value: &str) {
24 self.captures.insert(key.to_string(), value.to_string());
25 }
26}
27
28impl Captures<String, String> for UrlParams {
29 fn insert(&mut self, key: String, value: String) {
30 self.captures.insert(key, value);
31 }
32}