1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pub mod filter; mod router; pub use filter::*; pub use router::{DetectMatched, Router}; use std::collections::HashMap; pub type Params = HashMap<String, String>; #[derive(Debug)] pub struct PathState { pub segements: Vec<String>, pub match_cursor: usize, pub params: Params, } impl PathState { pub fn new(segements: Vec<String>) -> Self { PathState { segements, match_cursor: 0, params: Params::new(), } } }