Skip to main content

CommandUtils

Trait CommandUtils 

Source
pub trait CommandUtils {
    // Required methods
    fn exec(&mut self) -> Result<Output>;
    fn get_stdout_lossy(&mut self) -> Result<String>;
}
Expand description

Useful extensions to std::process::Command.

Required Methods§

Source

fn exec(&mut self) -> Result<Output>

Returns the command’s output if execution is successful, otherwise, throws an error.

Source

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

Implementations on Foreign Types§

Source§

impl CommandUtils for Command

Source§

fn exec(&mut self) -> Result<Output>

Source§

fn get_stdout_lossy(&mut self) -> Result<String>

Implementors§