Trait CommandExt

Source
pub trait CommandExt {
    // Required methods
    fn checked_output(&mut self) -> Result<Output, Error>;
    fn checked_status(&mut self) -> Result<(), Error>;
}
Expand description

Extension to std::process::Command adding versions of the output/status functions which also fail/error with a non-success exit status

Required Methods§

Source

fn checked_output(&mut self) -> Result<Output, Error>

Behaves like std::process::Command::output but also checks the exit status for success. The Output produced in case of a command returning a failing exit status is included into the error.

§Error

if the exit status is not successful or a io::Error was returned from Command::output

Source

fn checked_status(&mut self) -> Result<(), Error>

Behaves like std::process::Command::status but also checks the exit status for success, returning a error if it did not succeed

§Error

if the exit status is not successful or a io::Error was returned from Command::output

Implementations on Foreign Types§

Source§

impl CommandExt for Command

Implementors§