pub trait ResultExt<T> {
// Required method
fn expect_exit(self, msg: &str, code: i32) -> T;
}Available on crate feature
result only.Expand description
Result extensions designed to simplify console based tools.
Required Methods§
sourcefn expect_exit(self, msg: &str, code: i32) -> T
fn expect_exit(self, msg: &str, code: i32) -> T
Expects a given result to unwrap without issues, in case the result is an error, this function exits the program.
§Arguments
msg: a failure context message.code: the exit code to exit the program with in case of error.
returns: T the value if no errors have occurred.