Trait Reporter

Source
pub trait Reporter: Debug {
    // Required methods
    fn emit(
        &self,
        diagnostic: &Diagnostic,
        sources: &SourceFiles,
    ) -> Result<(), Error>;
    fn counters(&self) -> ReportCounters;
    fn done(&self, module_name: Option<String>) -> Result<ReportCounters, Error>;
    fn severity_filter(&self) -> SeverityFilter;
    fn set_severity_filter(&mut self, filter: SeverityFilter);

    // Provided methods
    fn emit_without_source(&self, diagnostic: &Diagnostic) -> Result<(), Error> { ... }
    fn log(&self, diagnostic: &Diagnostic) { ... }
    fn is_enabled(&self, level: Severity) -> bool { ... }
}
Expand description

This trait describes a facility to report diagnostics.

Required Methods§

Source

fn emit( &self, diagnostic: &Diagnostic, sources: &SourceFiles, ) -> Result<(), Error>

Emit a diagnostic, providing a mapping for source code.

Source

fn counters(&self) -> ReportCounters

Source

fn done(&self, module_name: Option<String>) -> Result<ReportCounters, Error>

Source

fn severity_filter(&self) -> SeverityFilter

Source

fn set_severity_filter(&mut self, filter: SeverityFilter)

Provided Methods§

Source

fn emit_without_source(&self, diagnostic: &Diagnostic) -> Result<(), Error>

Source

fn log(&self, diagnostic: &Diagnostic)

Source

fn is_enabled(&self, level: Severity) -> bool

Implementors§