[][src]Trait stdinout::OrExit

pub trait OrExit<R, S> where
    S: AsRef<str>, 
{ fn or_exit(self, message: S, code: i32) -> R; }

Types implementing the OrExit provide the or_exit function that can be used to exit a program when a computation was not successful.

The goal of this thread is to provide a function similar to unwrap() without a panic.

Required methods

fn or_exit(self, message: S, code: i32) -> R

Exit the program with the given message and status code if the computation is not successful. Otherwise, unwrap the value and return it.

Loading content...

Implementations on Foreign Types

impl<R, S, E> OrExit<R, S> for Result<R, E> where
    S: AsRef<str>,
    E: Display
[src]

impl<R, S> OrExit<R, S> for Option<R> where
    S: AsRef<str>, 
[src]

Loading content...

Implementors

Loading content...