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
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 segments: Vec<String>,
    pub match_cursor: usize,
    pub ending_matched: bool,
    pub params: Params,
}
impl PathState {
    pub fn new(segments: Vec<String>) -> Self {
        PathState {
            segments,
            match_cursor: 0,
            ending_matched: false,
            params: Params::new(),
        }
    }
}