Skip to main content

Formatter

Trait Formatter 

Source
pub trait Formatter {
    // Required method
    fn format(
        &mut self,
        event: &ParsedEvent,
        out: &mut dyn Write,
    ) -> Result<bool, FormatterError>;

    // Provided method
    fn header(&self) -> Option<&'static str> { ... }
}
Expand description

Formatter for one decoded event.

Formatters own their trailing newlines so that the bytes written are exactly the formatted output; the caller only selects the destination.

Required Methods§

Source

fn format( &mut self, event: &ParsedEvent, out: &mut dyn Write, ) -> Result<bool, FormatterError>

Write the event; returns whether any output was produced.

Provided Methods§

Source

fn header(&self) -> Option<&'static str>

Optional CSV header.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§