Trait expect_exit::Expected [−][src]
pub trait Expected<T> {
fn or_exit_(self, msg: &str) -> T;
fn or_exit<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn or_die_(self, msg: &str) -> T;
fn or_die<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn expect_or_exit_(self, msg: &str) -> T;
fn expect_or_exit<F>(self, f: F) -> T
where
F: FnOnce() -> String;
fn expect_or_die_(self, msg: &str) -> T;
fn expect_or_die<F>(self, f: F) -> T
where
F: FnOnce() -> String;
}
Expand description
Unwrap or exit with the specified message.
Required methods
Test the value. On success, return the unwrapped value. On error, unwind the stack, display the specified message, 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, and exit.
Test the value. On success, return the unwrapped value. On error, do not unwind the stack, display the specified message, 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, and exit.
fn expect_or_exit_(self, msg: &str) -> T
fn expect_or_exit_(self, msg: &str) -> T
Alias for Expected::or_exit_
.
fn expect_or_exit<F>(self, f: F) -> T where
F: FnOnce() -> String,
fn expect_or_exit<F>(self, f: F) -> T where
F: FnOnce() -> String,
Alias for Expected::or_exit
.
fn expect_or_die_(self, msg: &str) -> T
fn expect_or_die_(self, msg: &str) -> T
Alias for Expected::or_die_
.
fn expect_or_die<F>(self, f: F) -> T where
F: FnOnce() -> String,
fn expect_or_die<F>(self, f: F) -> T where
F: FnOnce() -> String,
Alias for Expected::or_die
.