Skip to main content

MessageFormatter

Trait MessageFormatter 

Source
pub trait MessageFormatter: Send + Sync {
    // Required method
    fn format(&self, error: &Error) -> String;
}
Expand description

Pluggable formatter for converting an Error into a user-visible message.

Implement this trait to plug in localisation, simplification, or rich formatting strategies. The trait is Send + Sync so a single formatter instance can be shared across threads.

Required Methods§

Source

fn format(&self, error: &Error) -> String

Render the supplied error as a single-string message.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§