Struct lexx::DiagnosticBuilder [] [src]

#[must_use]
pub struct DiagnosticBuilder<'a> { pub level: Level, pub message: String, pub code: Option<String>, pub span: MultiSpan, pub children: Vec<SubDiagnostic>, // some fields omitted }

Used for emitting structured error messages and other diagnostic information.

Fields

Methods

impl<'a> DiagnosticBuilder<'a>
[src]

Emit the diagnostic.

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.

Trait Implementations

impl<'a> Drop for DiagnosticBuilder<'a>
[src]

Destructor bomb - a DiagnosticBuilder must be either emitted or cancelled or we emit a bug.

impl<'a> Debug for DiagnosticBuilder<'a>
[src]

impl<'a> Clone for DiagnosticBuilder<'a>
[src]