Skip to main content

Module server

Module server 

Source
Expand description

Listener binding and the Axum server run loop.

Product binaries decide the bind address, build their own composed Router, and choose a shutdown signal (typically crate::shutdown_signal). This module owns the mechanical part every Axum HTTP surface repeats: bind a [TcpListener], hand it and the router to axum::serve, and optionally wire graceful shutdown.

Enums§

ServerError
Error binding a listener or running the server loop.

Functions§

bind
Bind a TCP listener at addr.
serve
Serve router on listener until the process is killed.
serve_with_shutdown
Serve router on listener, draining in-flight requests once shutdown resolves.