pub struct DiagnosticHandler { /* private fields */ }Expand description
A handler for collecting and emitting diagnostics.
Implementations§
Source§impl DiagnosticHandler
impl DiagnosticHandler
Sourcepub fn emit(&mut self, diagnostic: Diagnostic)
pub fn emit(&mut self, diagnostic: Diagnostic)
Emit a diagnostic.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if any errors have been emitted.
Sourcepub fn error_count(&self) -> usize
pub fn error_count(&self) -> usize
Get the number of errors.
Sourcepub fn warning_count(&self) -> usize
pub fn warning_count(&self) -> usize
Get the number of warnings.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Get all diagnostics.
Sourcepub fn take_diagnostics(&mut self) -> Vec<Diagnostic>
pub fn take_diagnostics(&mut self) -> Vec<Diagnostic>
Take all diagnostics, leaving the handler empty.
Trait Implementations§
Source§impl Debug for DiagnosticHandler
impl Debug for DiagnosticHandler
Source§impl Default for DiagnosticHandler
impl Default for DiagnosticHandler
Source§fn default() -> DiagnosticHandler
fn default() -> DiagnosticHandler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DiagnosticHandler
impl RefUnwindSafe for DiagnosticHandler
impl Send for DiagnosticHandler
impl Sync for DiagnosticHandler
impl Unpin for DiagnosticHandler
impl UnsafeUnpin for DiagnosticHandler
impl UnwindSafe for DiagnosticHandler
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