Skip to main content

serve_listener

Function serve_listener 

Source
fn serve_listener(
    listener: Async<TcpListener>,
    dir: &Path,
) -> Result<(), String>
Expand description

Serve dir on an already-bound listener until stopped.

Split from serve so a caller that has to know the URL — a test whose client connects to it — can bind first and read the address the listener actually got, rather than guess which port bind settled on.