Lines Matching full:router
32 // We use a `HashMap` to hold a `Router` for each HTTP method. This allows us
34 type Router = HashMap<Method, matchit::Router<Service>>; typedef
36 async fn route(router: Arc<Router>, req: Request<Body>) -> hyper::Result<Response<Body>> { in route() argument
38 let router = match router.get(req.method()) { in route() localVariable
39 Some(router) => router, in route()
45 match router.at(req.uri().path()) { in route()
58 // Create a router and register our routes. in main()
59 let mut router = Router::new(); in main() localVariable
62 router in main()
69 router in main()
76 let router = Arc::new(router); in main() localVariable
78 let router = router.clone(); in main() localVariable
79 async { Ok::<_, Infallible>(service_fn(move |request| route(router.clone(), request))) } in main()