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 with_extra_crates(self, extra_crate_ids: &[CrateId]) -> Self
pub fn with_extra_crates(self, extra_crate_ids: &[CrateId]) -> Self
Adds extra crates to be checked.
sourcepub fn check(&mut self, db: &RootDatabase) -> bool
pub fn check(&mut self, db: &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: &RootDatabase) -> Result<(), DiagnosticsError>
pub fn ensure(&mut self, db: &RootDatabase) -> Result<(), DiagnosticsError>
Checks if there are diagnostics and reports them to the provided callback as strings.
Returns Err
if diagnostics were found.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DiagnosticsReporter<'a>
impl<'a> !Send for DiagnosticsReporter<'a>
impl<'a> !Sync for DiagnosticsReporter<'a>
impl<'a> Unpin for DiagnosticsReporter<'a>
impl<'a> !UnwindSafe for DiagnosticsReporter<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more