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§

source

fn level(&self) -> DiagnosticLevel

The level of the diagnostic.

source

fn code(&self) -> Cow<'_, str>

The diagnostic code, like no-explicit-any or ban-untagged-ignore.

source

fn message(&self) -> Cow<'_, str>

The human-readable diagnostic message.

source

fn location(&self) -> DiagnosticLocation<'_>

The location this diagnostic is associated with.

source

fn snippet(&self) -> Option<DiagnosticSnippet<'_>>

A snippet showing the source code associated with the diagnostic.

source

fn hint(&self) -> Option<Cow<'_, str>>

A hint for fixing the diagnostic.

source

fn snippet_fixed(&self) -> Option<DiagnosticSnippet<'_>>

A snippet showing how the diagnostic can be fixed.

source

fn info(&self) -> Cow<'_, [Cow<'_, str>]>

source

fn docs_url(&self) -> Option<Cow<'_, str>>

An optional URL to the documentation for the diagnostic.

Provided Methods§

source

fn display(&self) -> DiagnosticDisplay<'_, Self>

Object Safety§

This trait is not object safe.

Implementors§