pub async fn serve_with_shutdown<F>(
listener: TcpListener,
router: Router,
shutdown: F,
) -> Result<(), ServerError>Expand description
Serve router on listener, draining in-flight requests once shutdown
resolves.
shutdown is any future — crate::shutdown_signal is a ready-made one
that resolves on Ctrl+C or SIGTERM.