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.

Alias for Expected::or_exit_.

Alias for Expected::or_exit.

Alias for Expected::or_die_.

Alias for Expected::or_die.

Implementations on Foreign Types

Implementors