use tower::Layer;
use super::App;
#[derive(Clone)]
pub(crate) struct AppLayer(pub App);
impl<S> Layer<S> for AppLayer {
type Service = AppService<S>;
fn layer(&self, inner: S) -> Self::Service {
AppService {
app: self.0.clone(),
inner,
}
}
}
#[derive(Clone)]
pub(crate) struct AppService<S> {
pub(crate) app: App,
pub(crate) inner: S,
}