Expand description
The IoContext typestate and the Command handler trait.
IoContext<S, O> is the server’s per-request work item, generic over its
lifecycle state S and origin O. Transitions consume self by value, so
the previous state becomes unusable — the borrow checker enforces the
request lifecycle. Everything here is static dispatch (see the plan’s §12).
Structs§
- IoContext
- The server’s work item for one request (or one server event). Owns the reply
header and — while
Solicited— the parsed request; parameterized by the lifecycle stateSand originO. - Resources
- Per-request access to the mutable connection and shared server state a handler needs. Borrowed for the duration of one dispatch on the connection’s single thread, so no locking is required for the per-connection half.
Enums§
- Outcome
- The result of serving one accepted request. Encodes the final-vs-interim distinction in the type system.