Struct DiagnosticReport
pub struct DiagnosticReport { /* private fields */ }Expand description
An insertion-order collection of diagnostics.
Implementations§
§impl DiagnosticReport
impl DiagnosticReport
pub const fn new() -> DiagnosticReport
pub const fn new() -> DiagnosticReport
Creates an empty diagnostic report.
pub fn add(&mut self, diagnostic: Diagnostic)
pub fn add(&mut self, diagnostic: Diagnostic)
Adds a diagnostic to the end of the report.
pub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Returns the diagnostics as a slice in insertion order.
pub fn iter(&self) -> Iter<'_, Diagnostic>
pub fn iter(&self) -> Iter<'_, Diagnostic>
Iterates diagnostics in insertion order.
pub fn count_by_level(&self, level: DiagnosticLevel) -> usize
pub fn count_by_level(&self, level: DiagnosticLevel) -> usize
Counts diagnostics with the exact provided level.
pub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Returns true when the report contains an error or fatal diagnostic.
pub fn highest_severity(&self) -> Option<DiagnosticLevel>
pub fn highest_severity(&self) -> Option<DiagnosticLevel>
Returns the highest diagnostic severity in the report.
pub fn extend_report(&mut self, other: DiagnosticReport)
pub fn extend_report(&mut self, other: DiagnosticReport)
Extends this report with diagnostics from another report, preserving insertion order.
Trait Implementations§
§impl Clone for DiagnosticReport
impl Clone for DiagnosticReport
§fn clone(&self) -> DiagnosticReport
fn clone(&self) -> DiagnosticReport
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 more§impl Debug for DiagnosticReport
impl Debug for DiagnosticReport
§impl Default for DiagnosticReport
impl Default for DiagnosticReport
§fn default() -> DiagnosticReport
fn default() -> DiagnosticReport
Returns the “default value” for a type. Read more
§impl FromIterator<Diagnostic> for DiagnosticReport
impl FromIterator<Diagnostic> for DiagnosticReport
§fn from_iter<T>(diagnostics: T) -> DiagnosticReportwhere
T: IntoIterator<Item = Diagnostic>,
fn from_iter<T>(diagnostics: T) -> DiagnosticReportwhere
T: IntoIterator<Item = Diagnostic>,
Creates a value from an iterator. Read more
§impl<'a> IntoIterator for &'a DiagnosticReport
impl<'a> IntoIterator for &'a DiagnosticReport
§type Item = &'a Diagnostic
type Item = &'a Diagnostic
The type of the elements being iterated over.
§type IntoIter = Iter<'a, Diagnostic>
type IntoIter = Iter<'a, Diagnostic>
Which kind of iterator are we turning this into?
§fn into_iter(self) -> <&'a DiagnosticReport as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a DiagnosticReport as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
§impl PartialEq for DiagnosticReport
impl PartialEq for DiagnosticReport
impl Eq for DiagnosticReport
impl StructuralPartialEq for DiagnosticReport
Auto Trait Implementations§
impl Freeze for DiagnosticReport
impl RefUnwindSafe for DiagnosticReport
impl Send for DiagnosticReport
impl Sync for DiagnosticReport
impl Unpin for DiagnosticReport
impl UnsafeUnpin for DiagnosticReport
impl UnwindSafe for DiagnosticReport
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