[][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]

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

impl<Span: ReportingSpan> Serialize for Diagnostic<Span> where
    Span: Serialize
[src]

impl<'de, Span: ReportingSpan> Deserialize<'de> for Diagnostic<Span> where
    Span: Deserialize<'de>, 
[src]

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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

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

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]