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§
Sourcefn emit(
&self,
diagnostic: &Diagnostic,
sources: &SourceFiles,
) -> Result<(), Error>
fn emit( &self, diagnostic: &Diagnostic, sources: &SourceFiles, ) -> Result<(), Error>
Emit a diagnostic, providing a mapping for source code.