[][src]Trait libimagerror::trace::MapErrTrace

pub trait MapErrTrace {
    type Output;
    fn map_err_trace(self) -> Self;
fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output; }

Helper functions for Result<T, E> types to reduce overhead in the following situations:

This example is not tested
function().map_err(|e| { trace_error(&e); e })

and variants

Associated Types

type Output

Loading content...

Required methods

fn map_err_trace(self) -> Self

fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output

Loading content...

Implementations on Foreign Types

impl<U> MapErrTrace for Result<U, Error>[src]

type Output = U

fn map_err_trace(self) -> Self[src]

Simply call trace_error() on the Err (if there is one) and return the error.

This does nothing besides the side effect of printing the error trace

fn map_err_trace_exit_unwrap(self, code: i32) -> Self::Output[src]

Trace the error and exit or unwrap the Ok(_).

Loading content...

Implementors

Loading content...