pub trait CommandExecutor {
// Required method
fn execute(&self, command: &CommandSpec) -> Result<CommandOutput, Error>;
// Provided methods
fn execute_cleanup(
&self,
command: &CommandSpec,
) -> Result<CommandOutput, Error> { ... }
fn cancellation_requested(&self) -> bool { ... }
fn stage_started(&self, _stage: ProvisionStage) { ... }
fn stage_finished(&self, _stage: ProvisionStage) { ... }
fn notify_notice(&self, _notice: &str) { ... }
fn before_move_source_stop(
&self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>> { ... }
fn reserve_move_destination(&self) { ... }
fn begin_resumable_move_work(&self) -> Result<(), Error> { ... }
fn end_resumable_move_work(&self) -> Result<(), Error> { ... }
fn execute_with_stdin(
&self,
_command: &CommandSpec,
_input: &mut (dyn Read + Send),
) -> Result<CommandOutput, Error> { ... }
}Required Methods§
fn execute(&self, command: &CommandSpec) -> Result<CommandOutput, Error>
Provided Methods§
Sourcefn execute_cleanup(&self, command: &CommandSpec) -> Result<CommandOutput, Error>
fn execute_cleanup(&self, command: &CommandSpec) -> Result<CommandOutput, Error>
Bound cleanup attempts while preserving supervisor cancellation. Durable owners retry interrupted cleanup under the next lifecycle or daemon.
Sourcefn cancellation_requested(&self) -> bool
fn cancellation_requested(&self) -> bool
Whether the operation supervising this executor has requested cancellation. Test executors and ordinary process execution are not cancellable unless they opt in.
Sourcefn stage_started(&self, _stage: ProvisionStage)
fn stage_started(&self, _stage: ProvisionStage)
Report entry into a lifecycle stage. Callers that cover more than one
command should hold a ProvisionStageGuard for the whole operation
so concurrent stages remain visible between subprocesses.
Sourcefn stage_finished(&self, _stage: ProvisionStage)
fn stage_finished(&self, _stage: ProvisionStage)
Report exit from a lifecycle stage previously passed to
Self::stage_started.
Sourcefn notify_notice(&self, _notice: &str)
fn notify_notice(&self, _notice: &str)
Report a decision an operation made on the user’s behalf. This is not a failure: the work continues, and the user is told what changed.
Sourcefn before_move_source_stop(
&self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
fn before_move_source_stop( &self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>
Stop the source’s children only once destination preparation has succeeded.
Sourcefn reserve_move_destination(&self)
fn reserve_move_destination(&self)
The Move source has been sealed; its destination belongs exclusively to the lifecycle until queue admission completes.
Sourcefn begin_resumable_move_work(&self) -> Result<(), Error>
fn begin_resumable_move_work(&self) -> Result<(), Error>
The durable Move owns this interruptible copy; daemon handoff may resume it.
fn end_resumable_move_work(&self) -> Result<(), Error>
fn execute_with_stdin( &self, _command: &CommandSpec, _input: &mut (dyn Read + Send), ) -> Result<CommandOutput, Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".