pub struct Diagnostics { /* private fields */ }Implementations§
Source§impl Diagnostics
impl Diagnostics
pub fn new() -> Self
Sourcepub fn report(
&mut self,
source: SourceId,
kind: DiagnosticKind,
range: TextRange,
) -> DiagnosticBuilder<'_>
pub fn report( &mut self, source: SourceId, kind: DiagnosticKind, range: TextRange, ) -> DiagnosticBuilder<'_>
Create a diagnostic with the given kind and span.
Uses the kind’s default message. Call .message() on the builder to override.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn has_errors(&self) -> bool
pub fn has_warnings(&self) -> bool
pub fn error_count(&self) -> usize
pub fn warning_count(&self) -> usize
Sourcepub fn printer<'q>(&self, sources: &'q SourceMap) -> DiagnosticsPrinter<'q>
pub fn printer<'q>(&self, sources: &'q SourceMap) -> DiagnosticsPrinter<'q>
Create a printer with a source map (multi-file support).
Sourcepub fn filtered_printer<'q>(
&self,
sources: &'q SourceMap,
) -> DiagnosticsPrinter<'q>
pub fn filtered_printer<'q>( &self, sources: &'q SourceMap, ) -> DiagnosticsPrinter<'q>
Filtered printer with source map (cascading errors suppressed).
Sourcepub fn render_colored(&self, sources: &SourceMap, colored: bool) -> String
pub fn render_colored(&self, sources: &SourceMap, colored: bool) -> String
Render with source map, colored output.
Sourcepub fn render_filtered(&self, sources: &SourceMap) -> String
pub fn render_filtered(&self, sources: &SourceMap) -> String
Render filtered with source map.
Sourcepub fn render_filtered_colored(
&self,
sources: &SourceMap,
colored: bool,
) -> String
pub fn render_filtered_colored( &self, sources: &SourceMap, colored: bool, ) -> String
Render filtered with source map, colored output.
pub fn extend(&mut self, other: Diagnostics)
Trait Implementations§
Source§impl Clone for Diagnostics
impl Clone for Diagnostics
Source§fn clone(&self) -> Diagnostics
fn clone(&self) -> Diagnostics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostics
impl Debug for Diagnostics
Source§impl Default for Diagnostics
impl Default for Diagnostics
Source§fn default() -> Diagnostics
fn default() -> Diagnostics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Diagnostics
impl RefUnwindSafe for Diagnostics
impl Send for Diagnostics
impl Sync for Diagnostics
impl Unpin for Diagnostics
impl UnwindSafe for Diagnostics
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