pub struct Diagnostics { /* private fields */ }Expand description
Diagnostics accumulated by one compilation.
Implementations§
Source§impl Diagnostics
impl Diagnostics
pub fn new() -> Diagnostics
pub fn push(&mut self, d: Diagnostic)
pub fn extend(&mut self, other: Diagnostics)
pub fn has_errors(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn truncate(&mut self, mark: usize)
pub fn truncate(&mut self, mark: usize)
Drop everything reported after a mark taken with Diagnostics::len.
For a check run only to learn something — the checker infers a typed macro call’s
arguments before the macro has decided what to do with them, and the real check of the
expansion is the one whose diagnostics a reader should see. Truncation rather than a
separate Diagnostics because it catches everything the run reported, including whatever
pushed without going through the caller.
pub fn iter(&self) -> impl Iterator<Item = &Diagnostic>
Sourcepub fn sorted(&self) -> Vec<&Diagnostic>
pub fn sorted(&self) -> Vec<&Diagnostic>
Sorted by position, so a snapshot does not depend on the order checks happened to run in.
pub fn render(&self, map: &SourceMap) -> String
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