Function any
fn any<H, T, S>(handler: H) -> MethodRouter<S, std::convert::Infallible>
where
H: Handler<T, S>,
T: 'static,
S: Clone + Send + Sync + 'static
Route requests with the given handler regardless of the method.
Example
use ;
async
// All requests to `/` will go to `handler`.
let app = new.route;
# let _: Router = app;
Additional methods can still be chained:
use ;
async
async
// `POST /` goes to `other_handler`. All other requests go to `handler`
let app = new.route;
# let _: Router = app;