pub struct DiagnosticSet { /* private fields */ }Expand description
A collection of diagnostics associated with a source file.
Implementations§
Source§impl DiagnosticSet
impl DiagnosticSet
Sourcepub fn add(&mut self, d: DiagnosticSpan)
pub fn add(&mut self, d: DiagnosticSpan)
Add a diagnostic.
Sourcepub fn add_warning(&mut self, span: Span, msg: impl Into<String>)
pub fn add_warning(&mut self, span: Span, msg: impl Into<String>)
Add a warning.
Sourcepub fn count_severity(&self, sev: &SpanSeverity) -> usize
pub fn count_severity(&self, sev: &SpanSeverity) -> usize
Count diagnostics of a given severity.
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if there are any errors.
Sourcepub fn errors(&self) -> Vec<&DiagnosticSpan>
pub fn errors(&self) -> Vec<&DiagnosticSpan>
Get all errors.
Sourcepub fn warnings(&self) -> Vec<&DiagnosticSpan>
pub fn warnings(&self) -> Vec<&DiagnosticSpan>
Get all warnings.
Sourcepub fn sort_by_position(&mut self)
pub fn sort_by_position(&mut self)
Sort diagnostics by span start offset.
Sourcepub fn iter(&self) -> impl Iterator<Item = &DiagnosticSpan>
pub fn iter(&self) -> impl Iterator<Item = &DiagnosticSpan>
Iterate over all diagnostics.
Sourcepub fn merge(&mut self, other: DiagnosticSet)
pub fn merge(&mut self, other: DiagnosticSet)
Merge another set into this one.
Trait Implementations§
Source§impl Clone for DiagnosticSet
impl Clone for DiagnosticSet
Source§fn clone(&self) -> DiagnosticSet
fn clone(&self) -> DiagnosticSet
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 DiagnosticSet
impl Debug for DiagnosticSet
Source§impl Default for DiagnosticSet
impl Default for DiagnosticSet
Source§fn default() -> DiagnosticSet
fn default() -> DiagnosticSet
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DiagnosticSet
impl RefUnwindSafe for DiagnosticSet
impl Send for DiagnosticSet
impl Sync for DiagnosticSet
impl Unpin for DiagnosticSet
impl UnsafeUnpin for DiagnosticSet
impl UnwindSafe for DiagnosticSet
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