pub trait Emitter: Send + Sync {
// Required methods
fn buffer(&self) -> Buffer;
fn print(&self, buffer: Buffer) -> Result<(), Report>;
}Expand description
The Emitter trait is used for controlling how diagnostics are displayed.
An Emitter must produce a [Buffer] for use by the rendering internals, and its own print implementation.
When a diagnostic is being emitted, a new [Buffer] is allocated,
the diagnostic is rendered into it, and then the buffer is passed
to print for display by the Emitter implementation.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Emitter for CaptureEmitter
Available on crate feature
std only.