1Apply a [`tower::Layer`] to all routes in the router. 2 3This can be used to add additional processing to a request for a group 4of routes. 5 6Note that the middleware is only applied to existing routes. So you have to 7first add your routes (and / or fallback) and then call `layer` afterwards. Additional 8routes added after `layer` is called will not have the middleware added. 9 10Works similarly to [`Router::layer`](super::Router::layer). See that method for 11more details. 12 13# Example 14 15```rust 16use axum::{routing::get, Router}; 17use tower::limit::ConcurrencyLimitLayer; 18 19async fn hander() {} 20 21let app = Router::new().route( 22 "/", 23 // All requests to `GET /` will be sent through `ConcurrencyLimitLayer` 24 get(hander).layer(ConcurrencyLimitLayer::new(64)), 25); 26# async { 27# axum::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); 28# }; 29``` 30