Created
October 26, 2013 04:58
-
-
Save Earlz/7165430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub struct Route { | |
matcher: ~PatternMatcher, | |
handler: ~fn:Send+Freeze(&mut ControllerContext) | |
} | |
pub struct Router{ | |
routes: ~[Route], | |
} | |
pub trait PatternMatcher { | |
fn matches(&self, input: &str) -> MatchResult; | |
} | |
impl PatternMatcher for SimplePattern { .... } | |
pub struct SimplePattern { | |
pattern: ~str, | |
groups: ~[PatternGroup] | |
} | |
priv struct PatternGroup{ | |
name: ~str, | |
text: ~str, | |
valid_values: ~[~str], | |
match_all: bool, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment