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
//! Controller method metadata for the Arcature application DX layer (A4).
//!
//! The `#[controller]` macro generates [`ControllerMethod`] values as `const`
//! items — plain data with `&'static` slices, no allocation, no runtime
//! reflection. These descriptors feed `arc controllers` and `arc check`
//! inspection.

/// Metadata for a single controller method, generated by the
/// `#[controller]` attribute macro.
///
/// Every field is `&'static str` or `&'static [&'static str]` — no `Vec`,
/// no `String`, no allocation. A `const` array of `ControllerMethod` is the
/// inspection artifact consumed by `arc controllers` and `arc check`.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
pub struct ControllerMethod {
    /// The method name (e.g. `"show"`, `"store"`, `"index"`).
    pub name: &'static str,
    /// The parameter names (e.g. `["auth", "input"]`).
    pub params: &'static [&'static str],
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn controller_method_is_const_constructible() {
        const METHOD: ControllerMethod = ControllerMethod {
            name: "show",
            params: &["auth", "link"],
        };
        assert_eq!(METHOD.name, "show");
        assert_eq!(METHOD.params, ["auth", "link"]);
    }

    #[test]
    #[cfg(feature = "serde")]
    fn controller_method_serializes_to_json() {
        let method = ControllerMethod {
            name: "store",
            params: &["auth", "input"],
        };
        let json = serde_json::to_string(&method).unwrap();
        assert!(json.contains("\"name\":\"store\""), "name: {json}");
        assert!(json.contains("\"params\""), "params field present: {json}");
        assert!(
            json.contains("\"auth\"") && json.contains("\"input\""),
            "params values: {json}"
        );
    }
}