[][src]Trait eyre_impl::IntoErrorReporter

pub trait IntoErrorReporter<E, C, CO> where
    E: Error + Send + Sync + 'static, 
{ fn ext_context(self, context: CO) -> ErrorReporter<E, C>; }

Helper trait for creating error reporters from context in extension Traits

This trait is intended to be used by extension traits for Result so that you can write combinators that work on either std::error::Error types directly (thus creating a new ErrorReporter) or on types that own an ErrorReporter, which lets you implement error types with APIs such as in the example

Example of supported APIs

let val = fallible_fn()
            .note("This function can only be used in certain situations")
            .warn("Be careful not to use this fn in this specific situation")?;

Required methods

fn ext_context(self, context: CO) -> ErrorReporter<E, C>

Loading content...

Implementors

impl<C, CO, E> IntoErrorReporter<E, C, CO> for ErrorReporter<E, C> where
    E: Error + Send + Sync + 'static,
    C: ErrorContext<CO>, 
[src]

impl<E, C, CO> IntoErrorReporter<E, C, CO> for E where
    C: Default + ErrorContext<CO>,
    E: Error + Send + Sync + 'static, 
[src]

Loading content...