pub trait CommandExecutor: Send + Sync {
// Required methods
fn execute(&self, program: &str, args: &[&str]) -> Result<CommandOutput>;
fn execute_in_dir(
&self,
program: &str,
args: &[&str],
dir: &str,
) -> Result<CommandOutput>;
}Expand description
Trait for executing shell commands
This abstraction allows mocking command execution in tests.
Required Methods§
Sourcefn execute(&self, program: &str, args: &[&str]) -> Result<CommandOutput>
fn execute(&self, program: &str, args: &[&str]) -> Result<CommandOutput>
Execute a command and return its output
Sourcefn execute_in_dir(
&self,
program: &str,
args: &[&str],
dir: &str,
) -> Result<CommandOutput>
fn execute_in_dir( &self, program: &str, args: &[&str], dir: &str, ) -> Result<CommandOutput>
Execute a command in a specific directory