pub struct Diagnostics(/* private fields */);Available on crate feature
alloc only.Expand description
Collection of Diagnostics produced by a parse.
Returned by parse in Err when any diagnostic was emitted.
Implementations§
Source§impl Diagnostics
impl Diagnostics
Sourcepub fn into_inner(self) -> Vec<Diagnostic>
pub fn into_inner(self) -> Vec<Diagnostic>
Consumes self and returns the inner vector of diagnostics.
Sourcepub fn iter(&self) -> impl Iterator<Item = &Diagnostic>
pub fn iter(&self) -> impl Iterator<Item = &Diagnostic>
Iterates over the collected 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 · 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§impl Diagnostics for Diagnostics
impl Diagnostics for Diagnostics
Source§fn emit_unknown_content(&mut self, text: &str, span: Span)
fn emit_unknown_content(&mut self, text: &str, span: Span)
Called when the parser sees text it cannot interpret (e.g. invalid tokens).
Source§fn emit_unexpected(&mut self, actual: &str, expected: &[TokenType], span: Span)
fn emit_unexpected(&mut self, actual: &str, expected: &[TokenType], span: Span)
Called when the parser expected one of
expected token types but found actual.Source§fn emit_parse_number_error(
&mut self,
value: &str,
error: ParseNumberError,
span: Span,
)
fn emit_parse_number_error( &mut self, value: &str, error: ParseNumberError, span: Span, )
Called when parsing a G/M/T number fails (e.g. overflow, invalid format).
Source§fn emit_parse_int_error(
&mut self,
value: &str,
_error: ParseIntError,
span: Span,
)
fn emit_parse_int_error( &mut self, value: &str, _error: ParseIntError, span: Span, )
Called when parsing an N or O number fails (e.g. invalid integer, overflow).
Source§impl PartialEq for Diagnostics
impl PartialEq for Diagnostics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> HasDiagnostics for Dwhere
D: Diagnostics,
impl<D> HasDiagnostics for Dwhere
D: Diagnostics,
Source§fn diagnostics(&mut self) -> &mut dyn Diagnostics
fn diagnostics(&mut self) -> &mut dyn Diagnostics
Returns a mutable reference to the diagnostics sink used for this parse.