pub trait CommandExecutor {
// Required method
fn execute(&self, command: &CommandSpec) -> Result<CommandOutput, Error>;
// Provided methods
fn cancellation_requested(&self) -> bool { ... }
fn stage_started(&self, _stage: ProvisionStage) { ... }
fn stage_finished(&self, _stage: ProvisionStage) { ... }
fn notify_notice(&self, _notice: &str) { ... }
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 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.
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".