pub fn server_main<Opts, ServerFuture, ServerConstructor>(
server_constructor: ServerConstructor,
) -> i32
Expand description
Handles boilerplate setup for:
- tracing_subscriber configuration
- Signal pipe fixup
- Printing out errors
- Exit code management
The server constructor function consumes config, custom cli args, and a shutdown signal future, then returns an indefinitely-running future that represents the server.
This function blocks waiting for either the constructed server future to finish or a CTRL+C style signal.
Returns the process’s desired exit code.