Skip to main content

ErrorFmt

Trait ErrorFmt 

Source
pub trait ErrorFmt {
    // Required method
    fn create_format_obj(
        &self,
        settings: ErrorFmtSettings,
    ) -> ResultER<ErrorFormatObj>;

    // Provided methods
    fn stringify(&self, settings: ErrorFmtSettings) -> ResultER<String> { ... }
    fn stringify_obj(
        format_obj: ErrorFormatObj,
        settings: ErrorFmtSettings,
    ) -> ResultER<String> { ... }
}
Expand description

Trait for converting error types into a structured ErrorFormatObj tree.

Implement this trait to control how your type is formatted at different detail levels. The pipeline is: create_format_obj()ErrorFormatObjstringify()String

Required Methods§

Source

fn create_format_obj( &self, settings: ErrorFmtSettings, ) -> ResultER<ErrorFormatObj>

Convert this value into a structured format object.

Provided Methods§

Source

fn stringify(&self, settings: ErrorFmtSettings) -> ResultER<String>

Convert to string by first creating a format object, then stringifying it.

Source

fn stringify_obj( format_obj: ErrorFormatObj, settings: ErrorFmtSettings, ) -> ResultER<String>

Stringify an existing format object directly.

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.

Implementations on Foreign Types§

Source§

impl ErrorFmt for HashMap<String, Box<ErrorSensitivityLabel<ErrorAttachment>>>

Source§

impl ErrorFmt for DateTime<Utc>

Source§

impl ErrorFmt for SpanTrace

Implementors§