[−][src]Struct language_reporting::Diagnostic
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]
self,
labels: Labels
) -> Diagnostic<Span>
Trait Implementations
impl<Span: Clone + ReportingSpan> Clone for Diagnostic<Span>
[src]
fn clone(&self) -> 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]
impl<Span: ReportingSpan> Serialize for Diagnostic<Span> where
Span: Serialize,
[src]
Span: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, Span: ReportingSpan> Deserialize<'de> for Diagnostic<Span> where
Span: Deserialize<'de>,
[src]
Span: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl<Span> Send for Diagnostic<Span> where
Span: Send,
Span: Send,
impl<Span> Unpin for Diagnostic<Span> where
Span: Unpin,
Span: Unpin,
impl<Span> Sync for Diagnostic<Span> where
Span: Sync,
Span: Sync,
impl<Span> UnwindSafe for Diagnostic<Span> where
Span: UnwindSafe,
Span: UnwindSafe,
impl<Span> RefUnwindSafe for Diagnostic<Span> where
Span: RefUnwindSafe,
Span: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,