pub struct Diagnostics { /* private fields */ }Expand description
Every syntax error from one parse, plus the source label for the header.
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether there are no errors (a Diagnostics is only constructed when the
parse failed, so in practice this is always false).
Sourcepub fn set_file(&mut self, file: &str)
pub fn set_file(&mut self, file: &str)
Attach (or replace) the source label shown in the header — used by the compiler, which knows the file name the parser does not.
Sourcepub fn render(
&self,
max_classes: Option<usize>,
max_per_class: Option<usize>,
) -> String
pub fn render( &self, max_classes: Option<usize>, max_per_class: Option<usize>, ) -> String
Render the errors grouped by class.
max_classes caps how many classes are shown; max_per_class caps how
many places are listed within each class. None (or Some(0), or a cap
≥ the count) means “all”. A cap that hides some places adds a
… and N more <class> problems line; a cap that hides some classes adds
a … and N more classes footer.
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 (const: unstable) · 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 Display for Diagnostics
impl Display for Diagnostics
impl Eq for Diagnostics
Source§impl PartialEq for Diagnostics
impl PartialEq for Diagnostics
Source§fn eq(&self, other: &Diagnostics) -> bool
fn eq(&self, other: &Diagnostics) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Diagnostics
Auto Trait Implementations§
impl Freeze for Diagnostics
impl RefUnwindSafe for Diagnostics
impl Send for Diagnostics
impl Sync for Diagnostics
impl Unpin for Diagnostics
impl UnsafeUnpin 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