pub trait SupervisorPort: Send + Sync {
// Required methods
fn run_turn(
&self,
request: TurnRequest,
access: Arc<dyn TurnAccess>,
) -> BoxFuture<'_, Result<TurnOutcome, SupervisorError>>;
fn close_session(
&self,
print_id: PrintId,
close_reason: String,
) -> BoxFuture<'_, Result<(), SupervisorError>>;
}Expand description
The port the supervising agent is reached through.
Every method is asynchronous, the trait is dyn-compatible, and it is
shareable across threads, because the supervision core holds it behind
Arc<dyn SupervisorPort>.
Required Methods§
Sourcefn run_turn(
&self,
request: TurnRequest,
access: Arc<dyn TurnAccess>,
) -> BoxFuture<'_, Result<TurnOutcome, SupervisorError>>
fn run_turn( &self, request: TurnRequest, access: Arc<dyn TurnAccess>, ) -> BoxFuture<'_, Result<TurnOutcome, SupervisorError>>
Run one supervision turn, opening the session if it is not open.
access issues each run of the turn the credential it authenticates
to the server with; see access.
Sourcefn close_session(
&self,
print_id: PrintId,
close_reason: String,
) -> BoxFuture<'_, Result<(), SupervisorError>>
fn close_session( &self, print_id: PrintId, close_reason: String, ) -> BoxFuture<'_, Result<(), SupervisorError>>
Close the session watching one print.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".