Struct syntex_errors::diagnostic::Diagnostic [] [src]

#[must_use]
pub struct Diagnostic { pub level: Level, pub message: Vec<(String, Style)>, pub code: Option<String>, pub span: MultiSpan, pub children: Vec<SubDiagnostic>, }

Fields

Methods

impl Diagnostic
[src]

Cancel the diagnostic (a structured diagnostic must either be emitted or cancelled or it will panic when dropped). BEWARE: if this DiagnosticBuilder is an error, then creating it will bump the error count on the Handler and cancelling it won't undo that. If you want to decrement the error count you should use Handler::cancel.

Add a span/label to be included in the resulting snippet. This is pushed onto the MultiSpan that was created when the diagnostic was first built. If you don't call this function at all, and you just supplied a Span to create the diagnostic, then the snippet will just include that Span, which is called the primary span.

Prints out a message with a suggested edit of the code.

See diagnostic::RenderSpan::Suggestion for more information.

Used by a lint. Copies over all details but the "main message".

Trait Implementations

impl Clone for Diagnostic
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Diagnostic
[src]

Formats the value using the given formatter.

impl PartialEq for Diagnostic
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.