pub trait CommandUtils {
// Required methods
fn exec(&mut self) -> Result<Output>;
fn spawn_output(&mut self) -> Result<Output>;
fn get_stdout_lossy(&mut self) -> Result<String>;
}Expand description
Useful extensions to std::process::Command.
Required Methods§
Sourcefn exec(&mut self) -> Result<Output>
fn exec(&mut self) -> Result<Output>
Returns the command’s output if execution is successful, otherwise, throws an error.
Sourcefn spawn_output(&mut self) -> Result<Output>
fn spawn_output(&mut self) -> Result<Output>
Runs the command and returns its output whatever the exit status. Unlike
Command::output, the error names the program when it cannot be started.
Sourcefn get_stdout_lossy(&mut self) -> Result<String>
fn get_stdout_lossy(&mut self) -> Result<String>
Returns the command’s stdout if execution is successful, otherwise, throws an error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".