#[non_exhaustive]pub struct Diagnostic { /* private fields */ }Expand description
A parser or lexer diagnostic anchored in source text.
Constructed by SourceFile::parse; read fields through accessors so future
metadata (severity, codes, notes) can be added without breaking callers.
Diagnostic positions are 1-based Unicode scalar columns; byte ranges remain
available through Diagnostic::range.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub const fn line(&self) -> LineNumber
pub const fn line(&self) -> LineNumber
1-based line number of the diagnostic start.
Sourcepub const fn column(&self) -> CharColumn
pub const fn column(&self) -> CharColumn
1-based character column of the diagnostic start.
Sourcepub const fn end_column(&self) -> DiagnosticEndColumn
pub const fn end_column(&self) -> DiagnosticEndColumn
End-column shape for the diagnostic span.
DiagnosticEndColumn::SameLineEnd contains the exclusive 1-based
Unicode-scalar column for non-empty same-line spans. Empty and multi-line
spans are reported as distinct variants instead of a nullable column.
Sourcepub const fn category(&self) -> DiagnosticCategory
pub const fn category(&self) -> DiagnosticCategory
Parser diagnostic category from daml-parser.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 Diagnostic
impl Debug for Diagnostic
impl Eq for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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