pub struct Diagnostic {
pub severity: Severity,
pub code: String,
pub message: String,
pub primary: Box<Label>,
pub secondary: Vec<Label>,
pub help: Option<String>,
}Expand description
Stable diagnostic shared by text and JSON consumers.
Fields§
§severity: Severity§code: String§message: String§primary: Box<Label>§secondary: Vec<Label>§help: Option<String>Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn error(code: &str, message: impl Into<String>, span: SourceSpan) -> Self
pub fn warning(code: &str, message: impl Into<String>, span: SourceSpan) -> Self
pub fn with_primary_message(self, message: impl Into<String>) -> Self
pub fn with_secondary( self, span: SourceSpan, message: impl Into<String>, ) -> Self
pub fn with_help(self, help: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl<'de> Deserialize<'de> for Diagnostic
impl<'de> Deserialize<'de> for Diagnostic
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
impl Eq for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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