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§
Sourcefn format(
&mut self,
event: &ParsedEvent,
out: &mut dyn Write,
) -> Result<bool, FormatterError>
fn format( &mut self, event: &ParsedEvent, out: &mut dyn Write, ) -> Result<bool, FormatterError>
Write the event; returns whether any output was produced.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".