Function get_service
pub fn get_service<T, S>(svc: T) -> MethodRouter<S, T::Error>
where
T: Service<Request> + Clone + Send + Sync + 'static,
T::Response: IntoResponse + 'static,
T::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.