Skip to main content

Crate printobserver_supervisor_api

Crate printobserver_supervisor_api 

Source
Expand description

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.

Re-exports§

pub use assessment::AgentAssessment;
pub use assessment::Confidence;
pub use session::SessionPhase;
pub use session::SupervisionSession;

Modules§

assessment
What a supervision turn answers with.
session
The supervision session one print is watched through.

Structs§

SupervisionSessionClosedPayload
A supervision session was closed.
SupervisionSessionOpenedPayload
A supervision session was opened.
TurnOutcome
What one supervision turn answered with.
TurnRequest
What one supervision turn is asked to consider.

Enums§

SupervisorError
Why a supervision turn did not produce an assessment.

Traits§

SupervisorPort
The port the supervising agent is reached through.

Type Aliases§

BoxFuture
A future this port’s methods answer with, in the one shape a trait object can carry.