gcode::core

Trait HasDiagnostics

Source
pub trait HasDiagnostics {
    // Required method
    fn diagnostics(&mut self) -> &mut dyn Diagnostics;
}
Expand description

Allows the parser to obtain a Diagnostics implementation from a visitor.

All visitor traits (ProgramVisitor, BlockVisitor, CommandVisitor) require this so the parser can report recoverable errors. Implement by returning a mutable reference to your diagnostics; the blanket impl for D: Diagnostics lets you use any diagnostics type as its own visitor when you only need to record errors.

Required Methods§

Source

fn diagnostics(&mut self) -> &mut dyn Diagnostics

Returns a mutable reference to the diagnostics sink used for this parse.

Implementors§