usher 0.1.1

Parameterized routing for generic resources in Rust
Documentation
// use usher::prelude::*;

// enum RouteOrRouter<T> {
//     Route(T),
//     Router(Box<Router<RouteOrRouter<T>>>),
// }

fn main() {
    //     // First we construct our `Router` using a set of parsers. Fortunately for
    //     // this example, Usher includes the `StaticParser` which uses basic string
    //     // matching to determine whether a segment in the path matches.
    //     let mut router = generate_router();

    //     // Then we insert our routes; in this case we're going to store the numbers
    //     // 1, 2 and 3, against their equivalent name in typed English (with a "/"
    //     // as a prefix, as Usher expects filesystem-like paths (for now)).
    //     router.insert(
    //         "/numbers",
    //         RouteOrRouter::Router(Box::new(generate_router())),
    //     );

    //     // Finally we'll just do a lookup on each path, as well as the a path which
    //     // doesn't match ("/"), just to demonstrate what the return types look like.
    //     for path in &[
    //         "/",
    //         "/one",
    //         "/two",
    //         "/three",
    //         "/numbers/one",
    //         "/numbers/two",
    //         "/numbers/three",
    //     ] {
    //         if let Some((RouteOrRouter::Route(ref value), ref captures)) = router.lookup(path) {
    //             println!("{}: {:?} {:?}", path, value, captures);
    //         }
    //     }
}

// fn generate_router() -> Router<RouteOrRouter<String>> {
//     let mut router: Router<RouteOrRouter<String>> = Router::new(vec![Box::new(StaticParser)]);

//     router.insert("/one", RouteOrRouter::Route("1".to_string()));
//     router.insert("/two", RouteOrRouter::Route("2".to_string()));
//     router.insert("/three", RouteOrRouter::Route("3".to_string()));

//     router
// }

// fn nested_routing(router: &sRouteOrRouter<T>) -> Option<Route<T>> {}