Skip to main content

CommandExecutor

Trait CommandExecutor 

Source
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§

Provided Methods§

Source

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.

Source

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.

Source

fn stage_finished(&self, _stage: ProvisionStage)

Report exit from a lifecycle stage previously passed to Self::stage_started.

Source

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.

Source

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".

Implementors§