1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Router;


/// TypeHandler is used to configure the spring-macro marked route handler
pub trait TypedHandler: Clone {
    fn install_route(self, router: Router) -> Router;
}

pub trait TypeRouter {
    fn typed_route<H: TypedHandler>(self, handler: H) -> Self;
}

impl TypeRouter for Router {
    fn typed_route<H: TypedHandler>(self, handler: H) -> Self {
        handler.install_route(self)
    }
}