Formatter

Trait Formatter 

Source
pub trait Formatter {
    // Required method
    fn format<W: Write>(
        &self,
        result: &LintResult,
        filename: &str,
        writer: &mut W,
    ) -> Result<()>;

    // Provided method
    fn format_to_string(&self, result: &LintResult, filename: &str) -> String { ... }
}
Expand description

Trait for formatting lint results.

Required Methods§

Source

fn format<W: Write>( &self, result: &LintResult, filename: &str, writer: &mut W, ) -> Result<()>

Format the lint result and write to the given writer.

Provided Methods§

Source

fn format_to_string(&self, result: &LintResult, filename: &str) -> String

Format the lint result to a string.

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.

Implementors§