pub fn build_connection<I, S, B>(
io: I,
service: S,
http2_enabled: bool,
) -> UpgradeableConnection<'static, I, S, TokioExecutor>Expand description
Builds (but does not drive) a connection future for io, ready to be either
.awaited directly or handed to a graceful-shutdown watcher.
Both protocol paths go through the hyper-util auto builder so they share
one connection type that implements
GracefulConnection:
http1_only() for strict HTTP/1.1, or h2 (auto-detected, extended CONNECT
enabled) otherwise. .into_owned() detaches the connection from the builder
so it is 'static and can be spawned. See serve_connection for the
simple await-and-log path.