use sword_core::ControllerSpec;
pub use sword_macros::{connect, controller, delete, get, head, options, patch, post, put, trace};
pub trait WebController: ControllerSpec {
fn base_path() -> &'static str;
}
use axum::routing::MethodRouter;
use std::any::TypeId;
use sword_core::State;
#[derive(Clone)]
pub struct WebControllerRegistrar {
pub controller_id: TypeId,
pub controller_path: &'static str,
pub build: fn(&State),
}
#[derive(Clone)]
pub struct RouteRegistrar {
pub controller_id: TypeId,
pub path: &'static str,
pub handler: fn(State) -> MethodRouter<State>,
}
inventory::collect!(WebControllerRegistrar);
inventory::collect!(RouteRegistrar);