Trait expect_exit::ExpectedWithError
source · [−]pub trait ExpectedWithError<T>: Expected<T> {
fn or_exit_e<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn or_die_e<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn or_exit_e_(self, msg: &str) -> T { ... }
fn or_die_e_(self, msg: &str) -> T { ... }
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
Provided Methods
sourcefn 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.
sourcefn or_die_e_(self, msg: &str) -> T
fn or_die_e_(self, msg: &str) -> T
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.
sourcefn expect_or_exit_perror_(self, msg: &str) -> T
fn expect_or_exit_perror_(self, msg: &str) -> T
Alias for ExpectedWithError::or_exit_e_.
sourcefn expect_or_exit_perror<F>(self, f: F) -> Twhere
F: FnOnce() -> String,
fn expect_or_exit_perror<F>(self, f: F) -> Twhere
F: FnOnce() -> String,
Alias for ExpectedWithError::or_exit_e.
sourcefn expect_or_die_perror_(self, msg: &str) -> T
fn expect_or_die_perror_(self, msg: &str) -> T
Alias for ExpectedWithError::or_die_e_.
sourcefn expect_or_die_perror<F>(self, f: F) -> Twhere
F: FnOnce() -> String,
fn expect_or_die_perror<F>(self, f: F) -> Twhere
F: FnOnce() -> String,
Alias for ExpectedWithError::or_die_e.