pub trait UnwrapReject<T> {
// Required methods
fn unwrap_or_reject(self) -> T;
fn expect_or_reject(self, msg: &str) -> T;
}Expand description
Extension trait for Option and Result that panics with a custom message on failure.
Required Methods§
Sourcefn unwrap_or_reject(self) -> T
fn unwrap_or_reject(self) -> T
Unwraps the value with a default panic message.
Sourcefn expect_or_reject(self, msg: &str) -> T
fn expect_or_reject(self, msg: &str) -> T
Unwraps the value with a custom panic message.