Skip to main content

bind_server

Function bind_server 

Source
pub async fn bind_server(
    addr: impl ToSocketAddrs,
    kernel: AsyncHttpKernel,
) -> Result<(BoundServer, ShutdownHandle), Error>
Expand description

Binds addr and returns a BoundServer plus ShutdownHandle (does not block).

Prefer listen for the usual “run until cancel” path. Use this when the caller needs a handle for graceful shutdown in tests.

§Errors

Propagates bind errors.