arcature 2026.1.0

Arcature application framework: a high-level Application facade over the certified Arcature subsystems, with the low-level Axum/Tower escape hatch preserved.
Documentation
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,
{
    /// Apply a Tower layer to the application.
    ///
    /// Forwards to [`axum::Router::layer`], wrapping the application's
    /// route service. `layer` must be a Tower [`Layer`] over [`axum::routing::Route`];
    /// the bounds mirror `Router::layer`. Arcature does not implement its own
    /// middleware ecosystem — use Tower layers directly (e.g. those from
    /// [`tower`] or `tower-http`) and the escape hatch stays open.
    ///
    /// The layer runs after routing, on every matched route. The state type
    /// `S` is preserved.
    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),
        }
    }
}