pub struct DiagnosticsReporter<'a> { /* private fields */ }
Expand description
Collects compilation diagnostics and presents them in preconfigured way.
Implementations§
source§impl DiagnosticsReporter<'static>
impl DiagnosticsReporter<'static>
sourcepub fn ignoring() -> Self
pub fn ignoring() -> Self
Create a reporter which does not print or collect diagnostics at all.
sourcepub fn stderr() -> Self
pub fn stderr() -> Self
Create a reporter which prints all diagnostics to std::io::Stderr
.
source§impl<'a> DiagnosticsReporter<'a>
impl<'a> DiagnosticsReporter<'a>
sourcepub fn callback(callback: impl FnMut(String) + 'a) -> Self
pub fn callback(callback: impl FnMut(String) + 'a) -> Self
Create a reporter which calls callback
for each diagnostic.
sourcepub fn write_to_string(string: &'a mut String) -> Self
pub fn write_to_string(string: &'a mut String) -> Self
Create a reporter which appends all diagnostics to provided string.
sourcepub fn check(&mut self, db: &mut RootDatabase) -> bool
pub fn check(&mut self, db: &mut RootDatabase) -> bool
Checks if there are diagnostics and reports them to the provided callback as strings.
Returns true
if diagnostics were found.
sourcepub fn ensure(&mut self, db: &mut RootDatabase) -> Result<(), DiagnosticsError>
pub fn ensure(&mut self, db: &mut RootDatabase) -> Result<(), DiagnosticsError>
Checks if there are diagnostics and reports them to the provided callback as strings.
Returns Err
if diagnostics were found.