pub struct SyntaxDiagnostic { /* private fields */ }Expand description
A parse-level problem (an ERROR or MISSING region) with its span.
Implementations§
Source§impl SyntaxDiagnostic
impl SyntaxDiagnostic
Sourcepub fn new(
kind: SyntaxDiagnosticKind,
span: SourceSpan,
message: impl Into<String>,
) -> Self
pub fn new( kind: SyntaxDiagnosticKind, span: SourceSpan, message: impl Into<String>, ) -> Self
Builds a syntax diagnostic from its kind, span, and message.
Sourcepub fn kind(&self) -> SyntaxDiagnosticKind
pub fn kind(&self) -> SyntaxDiagnosticKind
How the parser recovered at this location.
Sourcepub fn span(&self) -> &SourceSpan
pub fn span(&self) -> &SourceSpan
Where the problem is in the source.
Trait Implementations§
Source§impl Clone for SyntaxDiagnostic
impl Clone for SyntaxDiagnostic
Source§fn clone(&self) -> SyntaxDiagnostic
fn clone(&self) -> SyntaxDiagnostic
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 SyntaxDiagnostic
impl Debug for SyntaxDiagnostic
Source§impl<'de> Deserialize<'de> for SyntaxDiagnostic
impl<'de> Deserialize<'de> for SyntaxDiagnostic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SyntaxDiagnostic
Source§impl PartialEq for SyntaxDiagnostic
impl PartialEq for SyntaxDiagnostic
Source§impl Serialize for SyntaxDiagnostic
impl Serialize for SyntaxDiagnostic
impl StructuralPartialEq for SyntaxDiagnostic
Auto Trait Implementations§
impl Freeze for SyntaxDiagnostic
impl RefUnwindSafe for SyntaxDiagnostic
impl Send for SyntaxDiagnostic
impl Sync for SyntaxDiagnostic
impl Unpin for SyntaxDiagnostic
impl UnsafeUnpin for SyntaxDiagnostic
impl UnwindSafe for SyntaxDiagnostic
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