routerman/request/params.rs
1use std::{collections::HashMap, fmt::Debug};
2
3pub struct RouteParams(pub(crate) HashMap<Box<str>, Box<str>>);
4
5impl RouteParams {
6 pub fn get(&self, param: impl AsRef<str>) -> Option<&str> {
7 self.0.get(param.as_ref()).map(|v| &**v)
8 }
9}
10
11impl Debug for RouteParams {
12 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13 f.debug_map().entries(self.0.iter()).finish()
14 }
15}