pub struct Diagnostics { /* private fields */ }Implementations§
Source§impl Diagnostics
impl Diagnostics
pub fn new() -> Self
Sourcepub fn report(
&mut self,
kind: DiagnosticKind,
range: TextRange,
) -> DiagnosticBuilder<'_>
pub fn report( &mut self, 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.
Sourcepub fn error(
&mut self,
msg: impl Into<String>,
range: TextRange,
) -> DiagnosticBuilder<'_>
pub fn error( &mut self, msg: impl Into<String>, range: TextRange, ) -> DiagnosticBuilder<'_>
Create an error diagnostic (legacy API, prefer report()).
Sourcepub fn warning(
&mut self,
msg: impl Into<String>,
range: TextRange,
) -> DiagnosticBuilder<'_>
pub fn warning( &mut self, msg: impl Into<String>, range: TextRange, ) -> DiagnosticBuilder<'_>
Create a warning diagnostic (legacy API, prefer report()).
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
pub fn printer<'a>(&self, source: &'a str) -> DiagnosticsPrinter<'a>
Sourcepub fn filtered_printer<'a>(&self, source: &'a str) -> DiagnosticsPrinter<'a>
pub fn filtered_printer<'a>(&self, source: &'a str) -> DiagnosticsPrinter<'a>
Printer that uses filtered diagnostics (cascading errors suppressed).
pub fn render(&self, source: &str) -> String
pub fn render_colored(&self, source: &str, colored: bool) -> String
pub fn render_filtered(&self, source: &str) -> String
pub fn render_filtered_colored(&self, source: &str, colored: bool) -> String
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§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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)