Type Alias Diagnostic

Source
pub type Diagnostic = Diagnostic<()>;

Aliased Type§

pub struct Diagnostic {
    pub severity: Severity,
    pub code: Option<String>,
    pub message: String,
    pub labels: Vec<Label<()>>,
    pub notes: Vec<String>,
}

Fields§

§severity: Severity

The overall severity of the diagnostic

§code: Option<String>

An optional code that identifies this diagnostic.

§message: String

The main message associated with this diagnostic.

These should not include line breaks, and in order support the ‘short’ diagnostic display mod, the message should be specific enough to make sense on its own, without additional context provided by labels and notes.

§labels: Vec<Label<()>>

Source labels that describe the cause of the diagnostic. The order of the labels inside the vector does not have any meaning. The labels are always arranged in the order they appear in the source code.

§notes: Vec<String>

Notes that are associated with the primary cause of the diagnostic. These can include line breaks for improved formatting.