use super::App;
use axum::extract::Request;
use axum::response::IntoResponse;
use axum::routing::Route;
use tower::Layer;
impl<S> App<S>
where
S: Clone + Send + Sync + 'static,
{
pub fn layer<L>(self, layer: L) -> Self
where
L: Layer<Route> + Clone + Send + Sync + 'static,
L::Service: tower::Service<Request> + Clone + Send + Sync + 'static,
<L::Service as tower::Service<Request>>::Response: IntoResponse + 'static,
<L::Service as tower::Service<Request>>::Error: Into<std::convert::Infallible> + 'static,
<L::Service as tower::Service<Request>>::Future: Send + 'static,
{
App {
router: self.router.layer(layer),
}
}
}