Drives an application's lifespan protocol (← uvicorn's LifespanOn).
One invocation of the application runs under a Lifespan scope for the server's whole life:
startup sends lifespan.startup and waits for the answer, shutdown sends
lifespan.shutdown. state is the scope's namespace; the server gives every request scope a
shallow copy, so what startup stores there reaches each request.
mode is uvicorn's --lifespan: under Auto an application that fails on the lifespan scope,
as one serving only HTTP does, is taken not to speak the protocol and the server carries on;
under On that failure stops the boot; under Off nothing runs.