Function get_service
fn get_service<T, S>(svc: T) -> MethodRouter<S, <T as >::Error>
where
T: Service<Request> + Clone + Send + Sync + 'static,
<T as >::Response: IntoResponse + 'static,
<T as >::Future: Send + 'static,
S: Clone
Route GET requests to the given service.
Example
use ;
use Response;
use Infallible;
let service = service_fn;
// Requests to `GET /` will go to `service`.
let app = new.route;
# let _: Router = app;
Note that get routes will also be called for HEAD requests but will have
the response body removed. Make sure to add explicit HEAD routes
afterwards.