[][src]Struct language_reporting::Diagnostic

pub struct Diagnostic<Span: ReportingSpan> {
    pub severity: Severity,
    pub code: Option<String>,
    pub message: String,
    pub labels: Vec<Label<Span>>,
}

Represents a diagnostic message and associated child messages.

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

labels: Vec<Label<Span>>

The labelled spans marking the regions of code that cause this diagnostic to be raised

Methods

impl<Span: ReportingSpan> Diagnostic<Span>
[src]

pub fn new<S: Into<String>>(severity: Severity, message: S) -> Diagnostic<Span>
[src]

pub fn new_bug<S: Into<String>>(message: S) -> Diagnostic<Span>
[src]

pub fn new_error<S: Into<String>>(message: S) -> Diagnostic<Span>
[src]

pub fn new_warning<S: Into<String>>(message: S) -> Diagnostic<Span>
[src]

pub fn new_note<S: Into<String>>(message: S) -> Diagnostic<Span>
[src]

pub fn new_help<S: Into<String>>(message: S) -> Diagnostic<Span>
[src]

pub fn with_code<S: Into<String>>(self, code: S) -> Diagnostic<Span>
[src]

pub fn with_label(self, label: Label<Span>) -> Diagnostic<Span>
[src]

pub fn with_labels<Labels: IntoIterator<Item = Label<Span>>>(
    self,
    labels: Labels
) -> Diagnostic<Span>
[src]

Trait Implementations

impl<Span: Clone + ReportingSpan> Clone for Diagnostic<Span>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Span: Debug + ReportingSpan> Debug for Diagnostic<Span>
[src]

Auto Trait Implementations

impl<Span> Send for Diagnostic<Span> where
    Span: Send

impl<Span> Sync for Diagnostic<Span> where
    Span: Sync

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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