pub trait ContextHandler<C>: 'static {
// Required methods
fn source(value: &C) -> Option<&(dyn Error + 'static)>;
fn display(value: &C, formatter: &mut Formatter<'_>) -> Result;
fn debug(value: &C, formatter: &mut Formatter<'_>) -> Result;
// Provided method
fn preferred_formatting_style(
value: &C,
report_formatting_function: FormattingFunction,
report_formatting_alternate: bool,
) -> ContextFormattingStyle { ... }
}Expand description
Handler used to implement or override the behavior of core::error::Error, core::fmt::Display and
core::fmt::Debug when creating a report.
Required Methods§
Sourcefn source(value: &C) -> Option<&(dyn Error + 'static)>
fn source(value: &C) -> Option<&(dyn Error + 'static)>
The function used when calling RawReportRef::context_source
Provided Methods§
Sourcefn preferred_formatting_style(
value: &C,
report_formatting_function: FormattingFunction,
report_formatting_alternate: bool,
) -> ContextFormattingStyle
fn preferred_formatting_style( value: &C, report_formatting_function: FormattingFunction, report_formatting_alternate: bool, ) -> ContextFormattingStyle
The formatting style preferred by the context when formatted as part of a report.
§Arguments
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.