Function on
fn on<H, T, S>(filter: crate::routing::MethodFilter, handler: H) -> MethodRouter<S, std::convert::Infallible>
where
H: Handler<T, S>,
T: 'static,
S: Clone + Send + Sync + 'static
Route requests with the given method to the handler.
Example
use ;
async
// Requests to `POST /` will go to `handler`.
let app = new.route;
# let _: Router = app;