caelix-core 0.0.9

Core primitives for the Caelix framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::any::Any;

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct RouteDef {
    pub method: &'static str,
    pub path: &'static str,
    pub handler: &'static str,
}

pub trait Controller {
    fn base_path() -> &'static str;
    fn routes() -> &'static [RouteDef] {
        &[]
    }
    fn register_routes(cfg: &mut dyn Any);
}