Trait flex_error::ErrorSource [−][src]
pub trait ErrorSource<Trace> {
type Source;
type Detail;
fn error_details(source: Self::Source) -> (Self::Detail, Option<Trace>);
}Expand description
A type implementing ErrorSource<Trace> is a proxy type that provides the
capability of extracting from an error source of type Self::Source,
returning error detail of type Self::Detail, and an optional error
tracer of type Tracer.
The proxy type Self is not used anywhere. We separate out Self
and Self::Source so that there can be different generic implementations
of error sources, such as for all E: Display or for all E: Error.
There are currently 4 types of error sources:
NoSource- Indicating the lack of any error sourceDisplayError- An error source that implementsDisplay.DisplayOnly- An error source that implementsDisplayand do not provide additional detail.DetailOnly- An error source that do not contain any error traceTraceError- An error source that implementsErrorwith no detail.ErrorReport- An error type defined byflex-errorthat contains both error details and error traces.
Associated Types
Required methods
Implementors
impl<E, Tracer> ErrorSource<Tracer> for DisplayError<E> where
E: Display,
Tracer: ErrorMessageTracer, impl<E, Tracer> ErrorSource<Tracer> for DisplayOnly<E> where
E: Display,
Tracer: ErrorMessageTracer,