pub trait Handler<T> {
type Responder: Responder;
type Future: Future<Output = Self::Responder>;
// Required method
fn handle(&self, req: Request<T>) -> Self::Future;
}
Expand description
Define a Handler of a potential http request
Implementing this trait on any type will allow the router to route request
towards it. Implemented by default on Controllers and on any async fn(Request<Body>) -> impl Responder