Trait expect_exit::ExpectedWithError [−][src]
pub trait ExpectedWithError<T>: Expected<T> {
fn or_exit_e_(self, msg: &str) -> T;
fn or_exit_e<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn or_die_e_(self, msg: &str) -> T;
fn or_die_e<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn expect_or_exit_perror_(self, msg: &str) -> T;
fn expect_or_exit_perror<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn expect_or_die_perror_(self, msg: &str) -> T;
fn expect_or_die_perror<F>(self, f: F) -> T
where
F: FnOnce() -> String;
}
Expand description
Unwrap or exit with an appropriate error message.
Required methods
fn or_exit_e_(self, msg: &str) -> T
fn or_exit_e_(self, msg: &str) -> T
Test the value. On success, return the unwrapped value. On error, unwind the stack, display the specified message, append an appropriate description of the error, and exit.
Test the value. On success, return the unwrapped value. On error, unwind the stack, call the supplied function to obtain an error message, display it, append an appropriate description of the error, and exit.
Test the value. On success, return the unwrapped value. On error, do not unwind the stack, display the specified message, append an appropriate description of the error, and exit.
Test the value. On success, return the unwrapped value. On error, do not unwind the stack, call the supplied function to obtain an error message, display it, append an appropriate description of the error, and exit.
fn expect_or_exit_perror_(self, msg: &str) -> T
fn expect_or_exit_perror_(self, msg: &str) -> T
Alias for ExpectedWithError::or_exit_e_
.
fn expect_or_exit_perror<F>(self, f: F) -> T where
F: FnOnce() -> String,
fn expect_or_exit_perror<F>(self, f: F) -> T where
F: FnOnce() -> String,
Alias for ExpectedWithError::or_exit_e
.
fn expect_or_die_perror_(self, msg: &str) -> T
fn expect_or_die_perror_(self, msg: &str) -> T
Alias for ExpectedWithError::or_die_e_
.
fn expect_or_die_perror<F>(self, f: F) -> T where
F: FnOnce() -> String,
fn expect_or_die_perror<F>(self, f: F) -> T where
F: FnOnce() -> String,
Alias for ExpectedWithError::or_die_e
.