Trait PanicUtils

Source
pub trait PanicUtils<T> {
    // Required method
    fn unwrap_or_exit(self, msg: &str) -> T;
}
Expand description

Helpers to panic or exit cleanly with messages.

Required Methods§

Source

fn unwrap_or_exit(self, msg: &str) -> T

If None or Err, logs the message and exits the program.

Implementations on Foreign Types§

Source§

impl<T> PanicUtils<T> for Option<T>

Source§

fn unwrap_or_exit(self, msg: &str) -> T

Source§

impl<T, U> PanicUtils<T> for Result<T, U>

Source§

fn unwrap_or_exit(self, msg: &str) -> T

Implementors§