1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Routing primitives re-exported through the Arcature facade.
//!
//! Normal application code routes through [`Routes`] (the certified Axum
//! router re-exported under the Arcature name) and the routing functions
//! below, so it never needs a direct `axum` import:
//!
//! ```
//! use arcature::prelude::*;
//!
//! # fn _r() -> Routes {
//! Routes::new().route("/", get(|| async { "ok" }))
//! # }
//! ```
//!
//! Expert code may still reach the raw types via [`crate::axum`].
//!
//! [`Routes`] is a re-export of [`axum::Router`] (not a wrapper): Arcature
//! does not implement a second router (engine spec §20). The re-export
//! preserves the upstream default `S = ()`, so `Routes::new()` infers the
//! stateless app just like `Router::new()`.
// `Routes<S>` is the certified `axum::Router`, re-exported under the Arcature
// name. The re-export (not a type alias) preserves `Router`'s built-in default
// type parameter `S = ()`, so `Routes::new()` resolves to `Router<()>` when the
// handler does not constrain `S` — exactly like the upstream `Router::new()`.
// A type alias would lose this default because alias defaults do not propagate
// to inherent methods.
pub use Router as Routes;
// The Axum method-routing constructors, re-exported so normal code never
// names `axum::` directly. These are the canonical upstream functions,
// forwarded verbatim.
pub use ;
// `from_fn` lets an application author Tower-style middleware against the
// matched request/response without a direct `axum::middleware` import. It is
// the same upstream adapter, forwarded.
pub use from_fn;