pub trait ResultExt<T, E> {
// Required methods
fn unwrap_chain(self) -> T;
fn expect_chain(self, msg: &str) -> T;
}
Expand description
A helper extension trait to “unwrap” results with an error chain.
Required Methods§
sourcefn unwrap_chain(self) -> T
fn unwrap_chain(self) -> T
Like Result::unwrap
, but wraps the error in the
DisplayErrorChain and prints out the full chain in case an Err(_)
value is encountered.
sourcefn expect_chain(self, msg: &str) -> T
fn expect_chain(self, msg: &str) -> T
Like Result::expect
, but wraps the error in the
DisplayErrorChain and prints out the full chain in case an Err(_)
value is encountered.