[][src]Struct libslide::diagnostics::Diagnostic

pub struct Diagnostic {
    pub kind: DiagnosticKind,
    pub code: &'static str,
    pub span: Span,
    pub title: String,
    pub msg: Option<String>,
    pub associated_diagnostics: Vec<AssociatedDiagnostic>,
    pub unspanned_associated_diagnostics: Vec<AssociatedDiagnostic>,
}

A diagnostic for slide source code.

Fields

kind: DiagnosticKind

The diagnostic kind.

code: &'static str

The diagnostic code.

span: Span

Source location for which the diagnostic is applicable.

title: String

A summarizing title for the diagnostic.

msg: Option<String>

Diagnostic message.

associated_diagnostics: Vec<AssociatedDiagnostic>

Any additional diagnostics associated with this one. The additional diagnostics may or may not cover the same span as this one.

unspanned_associated_diagnostics: Vec<AssociatedDiagnostic>

Any additional diagnostics associated with this one, not explicitly covering any span. Implicitly, these diagnostics cover the span of the primary one.

Implementations

impl Diagnostic[src]

pub(crate) fn span_err<S, M, C, N>(
    span: S,
    title: M,
    code: C,
    msg: N
) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>,
    C: Into<&'static str>,
    N: Into<Option<String>>, 
[src]

Creates an error diagnostic at a span.

pub(crate) fn span_warn<S, M, C, N>(
    span: S,
    title: M,
    code: C,
    msg: N
) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>,
    C: Into<&'static str>,
    N: Into<Option<String>>, 
[src]

Creates a warning diagnostic at a span.

pub(crate) fn with_note<M>(self, note: M) -> Diagnostic where
    M: Into<String>, 
[src]

Adds a note to the diagnostic.

pub(crate) fn with_help<M>(self, note: M) -> Diagnostic where
    M: Into<String>, 
[src]

Adds a help message to the diagnostic.

pub(crate) fn with_spanned_err<S, M>(self, span: S, note: M) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>, 
[src]

Adds an error to the diagnostic, possibly at a different span.

pub(crate) fn with_spanned_warn<S, M>(self, span: S, note: M) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>, 
[src]

Adds a warning to the diagnostic, possibly at a different span.

pub(crate) fn with_spanned_help<S, M>(self, span: S, note: M) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>, 
[src]

Adds a help message to the diagnostic, possibly at a different span.

pub(crate) fn with_spanned_note<S, M>(self, span: S, note: M) -> Diagnostic where
    S: Into<Span>,
    M: Into<String>, 
[src]

Adds a note to the diagnostic, possibly at a different span.

impl Diagnostic[src]

pub fn all_codes_with_explanations() -> HashMap<&'static str, &'static str>[src]

All diagnostic codes and their explanations.

Auto Trait Implementations

impl RefUnwindSafe for Diagnostic

impl Send for Diagnostic

impl Sync for Diagnostic

impl Unpin for Diagnostic

impl UnwindSafe for Diagnostic

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.