printobserver-supervisor-api 0.3.0

The supervisor port for printobserver.
Documentation

printobserver-supervisor-api.

Owns: the port the supervising agent is reached through — the trait for running one supervision turn and for closing a session, the two shapes those methods carry, that port's own error type, the assessment vocabulary a turn answers with ([assessment]), the session a turn opens or continues ([session]), and the two event kinds a session's opening and closing are written down under.

May depend on: printobserver-types only. A port that named an implementation would stop being a port.

Opening a session is not a call of its own

Opening or continuing is [SupervisorPort::run_turn]'s own doing, and the [SessionPhase] it answers is what says which happened. A separate open call would let a caller open a session it then never took a turn in.

Why the methods answer a boxed future

Every method is asynchronous, and the trait is dyn-compatible and shareable across threads, because the supervision core holds every port behind Arc<dyn Port>. An async fn in a trait is not dyn-compatible, so each method answers a [BoxFuture] instead.