IsFailure

Trait IsFailure 

Source
pub trait IsFailure {
    // Required methods
    fn failed(&self) -> bool;
    fn code(&self) -> i32;
    fn stdout(&self) -> Option<String>;
    fn stderr(&self) -> Option<String>;
}
Expand description

IsFailure - providing idiomatic ways to access fields without unwrapping

Returns options, partly as it might have been piped, and partly as Success does not have the stderr field

Required Methods§

Source

fn failed(&self) -> bool

idiomatic way to check if a command has failed

Source

fn code(&self) -> i32

get code without unwrapping

Source

fn stdout(&self) -> Option<String>

get stdout without unwrapping

Source

fn stderr(&self) -> Option<String>

get stderr without unwrapping

Implementations on Foreign Types§

Source§

impl IsFailure for Result<Success, Failure>

Source§

fn failed(&self) -> bool

Source§

fn code(&self) -> i32

Source§

fn stdout(&self) -> Option<String>

Source§

fn stderr(&self) -> Option<String>

Implementors§