display_error_chain

Trait ResultExt

source
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§

source

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.

source

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.

Implementations on Foreign Types§

source§

impl<T, E: Error> ResultExt<T, E> for Result<T, E>

source§

fn unwrap_chain(self) -> T

source§

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

Implementors§