Skip to main content

CommandExecutor

Trait CommandExecutor 

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

Provided Methods§

Source

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.

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 before_move_source_stop( &self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

Stop the source’s children only once destination preparation has succeeded.

Source

fn reserve_move_destination(&self)

The Move source has been sealed; its destination belongs exclusively to the lifecycle until queue admission completes.

Source

fn begin_resumable_move_work(&self) -> Result<(), Error>

The durable Move owns this interruptible copy; daemon handoff may resume it.

Source

fn end_resumable_move_work(&self) -> Result<(), Error>

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§