A good router should:
```rust let mut router = Router::new();
router.insertroute("all-products", "/product/all"); router.insertroute("product-detail", "/product/{id}");
// And now we can parse routes!
{ let route = router.parseroute("/not-found".toowned(),); assert_eq!(route, None); }
{ let route = router.parseroute("/product/all".toowned(),); asserteq!(route, Some(Route{ name: "all-products".toowned(), parameters: vec![], })); }
{ let route = router.parseroute("/product/1".toowned(),); asserteq!(route, Some(Route{ name: "product-detail".toowned(), parameters: vec![ ("id", "1"), ], })); }
// And we can stringify routes
{ let path = router.stringifyroute(Some(Route{ name: "all-products".toowned(), parameters: vec![], })); asserteq!(path, "/product/all".toowned(),); }
{ let path = router.stringifyroute(Some(Route{ name: "product-detail".toowned(), parameters: vec![ ("id", "1"), ], })); asserteq!(path, "/product/2".toowned()); } ```