pub struct Diagnostic<Span: ReportingSpan> {
pub severity: Severity,
pub code: Option<String>,
pub message: String,
pub labels: Vec<Label<Span>>,
}
Expand description
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
Implementations§
Source§impl<Span: ReportingSpan> Diagnostic<Span>
impl<Span: ReportingSpan> Diagnostic<Span>
pub fn new<S: Into<String>>(severity: Severity, message: S) -> Diagnostic<Span>
pub fn new_bug<S: Into<String>>(message: S) -> Diagnostic<Span>
pub fn new_error<S: Into<String>>(message: S) -> Diagnostic<Span>
pub fn new_warning<S: Into<String>>(message: S) -> Diagnostic<Span>
pub fn new_note<S: Into<String>>(message: S) -> Diagnostic<Span>
pub fn new_help<S: Into<String>>(message: S) -> Diagnostic<Span>
pub fn with_code<S: Into<String>>(self, code: S) -> Diagnostic<Span>
pub fn with_label(self, label: Label<Span>) -> Diagnostic<Span>
pub fn with_labels<Labels: IntoIterator<Item = Label<Span>>>( self, labels: Labels, ) -> Diagnostic<Span>
Trait Implementations§
Source§impl<Span: Clone + ReportingSpan> Clone for Diagnostic<Span>
impl<Span: Clone + ReportingSpan> Clone for Diagnostic<Span>
Source§fn clone(&self) -> Diagnostic<Span>
fn clone(&self) -> Diagnostic<Span>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Span: Debug + ReportingSpan> Debug for Diagnostic<Span>
impl<Span: Debug + ReportingSpan> Debug for Diagnostic<Span>
Source§impl<'de, Span> Deserialize<'de> for Diagnostic<Span>where
Span: Deserialize<'de> + ReportingSpan,
impl<'de, Span> Deserialize<'de> for Diagnostic<Span>where
Span: Deserialize<'de> + ReportingSpan,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Span> Serialize for Diagnostic<Span>where
Span: Serialize + ReportingSpan,
impl<Span> Serialize for Diagnostic<Span>where
Span: Serialize + ReportingSpan,
Auto Trait Implementations§
impl<Span> Freeze for Diagnostic<Span>
impl<Span> RefUnwindSafe for Diagnostic<Span>where
Span: RefUnwindSafe,
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,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)