Trait deno_ast::diagnostics::Diagnostic
source · pub trait Diagnostic {
// Required methods
fn level(&self) -> DiagnosticLevel;
fn code(&self) -> Cow<'_, str>;
fn message(&self) -> Cow<'_, str>;
fn location(&self) -> DiagnosticLocation<'_>;
fn snippet(&self) -> Option<DiagnosticSnippet<'_>>;
fn hint(&self) -> Option<Cow<'_, str>>;
fn snippet_fixed(&self) -> Option<DiagnosticSnippet<'_>>;
fn info(&self) -> Cow<'_, [Cow<'_, str>]>;
fn docs_url(&self) -> Option<Cow<'_, str>>;
// Provided method
fn display(&self) -> DiagnosticDisplay<'_, Self> { ... }
}
Required Methods§
sourcefn level(&self) -> DiagnosticLevel
fn level(&self) -> DiagnosticLevel
The level of the diagnostic.
sourcefn code(&self) -> Cow<'_, str>
fn code(&self) -> Cow<'_, str>
The diagnostic code, like no-explicit-any
or ban-untagged-ignore
.
sourcefn location(&self) -> DiagnosticLocation<'_>
fn location(&self) -> DiagnosticLocation<'_>
The location this diagnostic is associated with.
sourcefn snippet(&self) -> Option<DiagnosticSnippet<'_>>
fn snippet(&self) -> Option<DiagnosticSnippet<'_>>
A snippet showing the source code associated with the diagnostic.
sourcefn snippet_fixed(&self) -> Option<DiagnosticSnippet<'_>>
fn snippet_fixed(&self) -> Option<DiagnosticSnippet<'_>>
A snippet showing how the diagnostic can be fixed.
fn info(&self) -> Cow<'_, [Cow<'_, str>]>
Provided Methods§
fn display(&self) -> DiagnosticDisplay<'_, Self>
Object Safety§
This trait is not object safe.