Skip to main content

CommandExecutor

Trait CommandExecutor 

Source
pub trait CommandExecutor: Send + Sync {
    // Required methods
    fn execute(&self, command: Command) -> Result<Output>;
    fn dyn_clone(&self) -> Box<dyn CommandExecutor>;
}
Expand description

Executes Commands.

Required Methods§

Source

fn execute(&self, command: Command) -> Result<Output>

Runs a command and captures its standard output and standard error.

Source

fn dyn_clone(&self) -> Box<dyn CommandExecutor>

Creates an owned executor that can be moved to another thread.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§