Struct Diagnostic
pub struct Diagnostic { /* private fields */ }Expand description
A structured diagnostic data value.
Implementations§
§impl Diagnostic
impl Diagnostic
pub const fn new(
level: DiagnosticLevel,
message: DiagnosticMessage,
) -> Diagnostic
pub const fn new( level: DiagnosticLevel, message: DiagnosticMessage, ) -> Diagnostic
Creates a diagnostic with a level and message.
pub fn with_code(self, code: DiagnosticCode) -> Diagnostic
pub fn with_code(self, code: DiagnosticCode) -> Diagnostic
Returns a diagnostic with the provided code attached.
pub fn with_label(self, label: DiagnosticLabel) -> Diagnostic
pub fn with_label(self, label: DiagnosticLabel) -> Diagnostic
Returns a diagnostic with the provided label appended.
pub fn with_note(self, note: DiagnosticNote) -> Diagnostic
pub fn with_note(self, note: DiagnosticNote) -> Diagnostic
Returns a diagnostic with the provided note appended.
pub fn add_label(&mut self, label: DiagnosticLabel)
pub fn add_label(&mut self, label: DiagnosticLabel)
Appends a label.
pub fn add_note(&mut self, note: DiagnosticNote)
pub fn add_note(&mut self, note: DiagnosticNote)
Appends a note.
pub const fn code(&self) -> Option<&DiagnosticCode>
pub const fn code(&self) -> Option<&DiagnosticCode>
Returns the optional diagnostic code.
pub const fn level(&self) -> DiagnosticLevel
pub const fn level(&self) -> DiagnosticLevel
Returns the diagnostic level.
pub const fn message(&self) -> &DiagnosticMessage
pub const fn message(&self) -> &DiagnosticMessage
Returns the diagnostic message.
pub fn labels(&self) -> &[DiagnosticLabel]
pub fn labels(&self) -> &[DiagnosticLabel]
Returns the diagnostic labels.
pub fn notes(&self) -> &[DiagnosticNote]
pub fn notes(&self) -> &[DiagnosticNote]
Returns the diagnostic notes.
Trait Implementations§
§impl Clone for Diagnostic
impl Clone for Diagnostic
§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 more§impl Debug for Diagnostic
impl Debug for Diagnostic
§impl FromIterator<Diagnostic> for DiagnosticReport
impl FromIterator<Diagnostic> for DiagnosticReport
§fn from_iter<T>(diagnostics: T) -> DiagnosticReportwhere
T: IntoIterator<Item = Diagnostic>,
fn from_iter<T>(diagnostics: T) -> DiagnosticReportwhere
T: IntoIterator<Item = Diagnostic>,
Creates a value from an iterator. Read more
§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
impl Eq for Diagnostic
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