Goodrouter, the rust edition

A good router should:

Check out our (website)[https://www.goodrouter.org], join our (Discord server)[https://discord.gg/BJ8v7xTq8d]!

Example

```rust let mut router = Router::new();

router .insertroute("all-products", "/product/all") .insertroute("product-detail", "/product/{id}");

// And now we can parse routes!

{ let (routekey, routeparameters) = router.parseroute("/not-found"); asserteq!(routekey, None); asserteq!(routeparameters, vec![].intoiter().collect()); }

{ let (routekey, routeparameters) = router.parseroute("/product/all"); asserteq!(routekey, Some("all-products")); asserteq!(routeparameters, vec![].intoiter().collect()); }

{ let (routekey, routeparameters) = router.parseroute("/product/1"); asserteq!(routekey, Some("product-detail")); asserteq!( routeparameters, vec![("id", "1")] .intoiter() .map(|(k, v)| (k, Cow::Borrowed(v))) .collect() ); }

// And we can stringify routes

{ let routeparameters: HashMap<_, _> = vec![].intoiter().collect(); let path = router.stringifyroute("all-products", &routeparameters); asserteq!(path.unwrap().intoowned(), "/product/all".to_owned()); }

{ let routeparameters: HashMap<_, _> = vec![("id", "2")].intoiter().collect(); let path = router.stringifyroute("product-detail", &routeparameters); asserteq!(path.unwrap().intoowned(), "/product/2".to_owned()); } ```