• Home
  • Raw
  • Download

Lines Matching full:async

46 async fn hello_world() {  in hello_world()
47 async fn root(_: Request<Body>) -> &'static str { in hello_world()
51 async fn foo(_: Request<Body>) -> &'static str { in hello_world()
55 async fn users_create(_: Request<Body>) -> &'static str { in hello_world()
79 async fn routing() { in routing()
83 get(|_: Request<Body>| async { "users#index" }) in routing()
84 .post(|_: Request<Body>| async { "users#create" }), in routing()
86 .route("/users/:id", get(|_: Request<Body>| async { "users#show" })) in routing()
89 get(|_: Request<Body>| async { "users#action" }), in routing()
115 async fn router_type_doesnt_change() { in router_type_doesnt_change()
119 on(MethodFilter::GET, |_: Request<Body>| async { in router_type_doesnt_change()
122 .on(MethodFilter::POST, |_: Request<Body>| async { in router_type_doesnt_change()
140 async fn routing_between_services() { in routing_between_services()
144 async fn handle(_: Request<Body>) -> &'static str { in routing_between_services()
151 get_service(service_fn(|_: Request<Body>| async { in routing_between_services()
154 .post_service(service_fn(|_: Request<Body>| async { in routing_between_services()
159 service_fn(|_: Request<Body>| async { in routing_between_services()
186 async fn middleware_on_single_route() { in middleware_on_single_route()
190 async fn handle(_: Request<Body>) -> &'static str { in middleware_on_single_route()
213 async fn service_in_bottom() { in service_in_bottom()
214 async fn handler(_req: Request<Body>) -> Result<Response<Body>, Infallible> { in service_in_bottom()
224 async fn wrong_method_handler() { in wrong_method_handler()
226 .route("/", get(|| async {}).post(|| async {})) in wrong_method_handler()
227 .route("/foo", patch(|| async {})); in wrong_method_handler()
247 async fn wrong_method_service() { in wrong_method_service()
287 async fn multiple_methods_for_one_handler() { in multiple_methods_for_one_handler()
288 async fn root(_: Request<Body>) -> &'static str { in multiple_methods_for_one_handler()
304 async fn wildcard_sees_whole_url() { in wildcard_sees_whole_url()
305 let app = Router::new().route("/api/*rest", get(|uri: Uri| async move { uri.to_string() })); in wildcard_sees_whole_url()
314 async fn middleware_applies_to_routes_above() { in middleware_applies_to_routes_above()
319 .layer(HandleErrorLayer::new(|_: BoxError| async move { in middleware_applies_to_routes_above()
324 .route("/two", get(|| async {})); in middleware_applies_to_routes_above()
336 async fn not_found_for_extra_trailing_slash() { in not_found_for_extra_trailing_slash()
337 let app = Router::new().route("/foo", get(|| async {})); in not_found_for_extra_trailing_slash()
349 async fn not_found_for_missing_trailing_slash() { in not_found_for_missing_trailing_slash()
350 let app = Router::new().route("/foo/", get(|| async {})); in not_found_for_missing_trailing_slash()
359 async fn with_and_without_trailing_slash() { in with_and_without_trailing_slash()
361 .route("/foo", get(|| async { "without tsr" })) in with_and_without_trailing_slash()
362 .route("/foo/", get(|| async { "with tsr" })); in with_and_without_trailing_slash()
377 async fn wildcard_doesnt_match_just_trailing_slash() { in wildcard_doesnt_match_just_trailing_slash()
380 get(|Path(path): Path<String>| async move { path }), in wildcard_doesnt_match_just_trailing_slash()
397 async fn what_matches_wildcard() { in what_matches_wildcard()
399 .route("/*key", get(|| async { "root" })) in what_matches_wildcard()
400 .route("/x/*key", get(|| async { "x" })) in what_matches_wildcard()
401 .fallback(|| async { "fallback" }); in what_matches_wildcard()
407 async move { f.await.text().await } in what_matches_wildcard()
425 async fn static_and_dynamic_paths() { in static_and_dynamic_paths()
429 get(|Path(key): Path<String>| async move { format!("dynamic: {key}") }), in static_and_dynamic_paths()
431 .route("/foo", get(|| async { "static" })); in static_and_dynamic_paths()
444 async fn empty_route() { in empty_route()
445 let app = Router::new().route("", get(|| async {})); in empty_route()
450 async fn middleware_still_run_for_unmatched_requests() { in middleware_still_run_for_unmatched_requests()
475 .route("/", get(|| async {})) in middleware_still_run_for_unmatched_requests()
494 async fn routing_to_router_panics() { in routing_to_router_panics()
499 async fn route_layer() { in route_layer()
501 .route("/foo", get(|| async {})) in route_layer()
527 async fn different_methods_added_in_different_routes() { in different_methods_added_in_different_routes()
529 .route("/", get(|| async { "GET" })) in different_methods_added_in_different_routes()
530 .route("/", post(|| async { "POST" })); in different_methods_added_in_different_routes()
545 async fn merging_routers_with_fallbacks_panics() { in merging_routers_with_fallbacks_panics()
546 async fn fallback() {} in merging_routers_with_fallbacks_panics()
555 async fn handler() {} in routes_with_overlapping_method_routes()
564 async fn handler() {} in merging_with_overlapping_method_routes()
570 async fn merging_routers_with_same_paths_but_different_methods() { in merging_routers_with_same_paths_but_different_methods()
571 let one = Router::new().route("/", get(|| async { "GET" })); in merging_routers_with_same_paths_but_different_methods()
572 let two = Router::new().route("/", post(|| async { "POST" })); in merging_routers_with_same_paths_but_different_methods()
586 async fn head_content_length_through_hyper_server() { in head_content_length_through_hyper_server()
588 .route("/", get(|| async { "foo" })) in head_content_length_through_hyper_server()
589 .route("/json", get(|| async { Json(json!({ "foo": 1 })) })); in head_content_length_through_hyper_server()
603 async fn head_content_length_through_hyper_server_that_hits_fallback() { in head_content_length_through_hyper_server_that_hits_fallback()
604 let app = Router::new().fallback(|| async { "foo" }); in head_content_length_through_hyper_server_that_hits_fallback()
613 async fn head_with_middleware_applied() { in head_with_middleware_applied()
619 Router::new().route("/", get(|| async { "Hello, World!" })), in head_with_middleware_applied()
650 async fn routes_must_start_with_slash() { in routes_must_start_with_slash()
651 let app = Router::new().route(":foo", get(|| async {})); in routes_must_start_with_slash()
656 async fn body_limited_by_default() { in body_limited_by_default()
658 .route("/bytes", post(|_: Bytes| async {})) in body_limited_by_default()
659 .route("/string", post(|_: String| async {})) in body_limited_by_default()
660 .route("/json", post(|_: Json<serde_json::Value>| async {})); in body_limited_by_default()
684 async fn disabling_the_default_limit() { in disabling_the_default_limit()
686 .route("/", post(|_: Bytes| async {})) in disabling_the_default_limit()
700 async fn limited_body_with_content_length() { in limited_body_with_content_length()
706 post(|headers: HeaderMap, _body: Bytes| async move { in limited_body_with_content_length()
722 async fn changing_the_default_limit() { in changing_the_default_limit()
726 .route("/", post(|_: Bytes| async {})) in changing_the_default_limit()
747 async fn limited_body_with_streaming_body() { in limited_body_with_streaming_body()
753 post(|headers: HeaderMap, _body: Bytes| async move { in limited_body_with_streaming_body()
779 async fn extract_state() { in extract_state()
797 async fn handler(State(outer): State<AppState>, State(inner): State<InnerState>) { in extract_state()
815 async fn explicitly_set_state() { in explicitly_set_state()
819 get(|State(state): State<&'static str>| async move { state }).with_state("foo"), in explicitly_set_state()
829 async fn layer_response_into_response() { in layer_response_into_response()
837 .route("/", get(|| async {})) in layer_response_into_response()
849 async fn fallback(_: State<&'static str>) {} in method_router_fallback_with_state()
851 async fn not_found(_: State<&'static str>) {} in method_router_fallback_with_state()
876 async fn state_isnt_cloned_too_much() { in state_isnt_cloned_too_much()
914 .route("/", get(|_: State<AppState>| async {})) in state_isnt_cloned_too_much()
928 async fn logging_rejections() { in logging_rejections()
938 let events = capture_tracing::<RejectionEvent, _, _>(|| async { in logging_rejections()
940 .route("/extension", get(|_: Extension<Infallible>| async {})) in logging_rejections()
941 .route("/string", post(|_: String| async {})); in logging_rejections()
996 async fn connect_going_to_custom_fallback() { in connect_going_to_custom_fallback()
997 let app = Router::new().fallback(|| async { (StatusCode::NOT_FOUND, "custom fallback") }); in connect_going_to_custom_fallback()
1014 async fn connect_going_to_default_fallback() { in connect_going_to_default_fallback()
1031 async fn impl_handler_for_into_response() { in impl_handler_for_into_response()