Struct cargo_metadata::diagnostic::Diagnostic
source · #[non_exhaustive]pub struct Diagnostic {
pub message: String,
pub code: Option<DiagnosticCode>,
pub level: DiagnosticLevel,
pub spans: Vec<DiagnosticSpan>,
pub children: Vec<Diagnostic>,
pub rendered: Option<String>,
}
Expand description
A diagnostic message generated by rustc
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.message: String
The error message of this diagnostic.
code: Option<DiagnosticCode>
The associated error code for this diagnostic
level: DiagnosticLevel
“error: internal compiler error”, “error”, “warning”, “note”, “help”
spans: Vec<DiagnosticSpan>
A list of source code spans this diagnostic is associated with.
children: Vec<Diagnostic>
Associated diagnostic messages.
rendered: Option<String>
The message as rustc would render it
Trait Implementations§
source§impl Clone for Diagnostic
impl Clone for Diagnostic
source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 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
source§impl Display for Diagnostic
impl Display for Diagnostic
source§impl Hash for Diagnostic
impl Hash for Diagnostic
source§impl PartialEq<Diagnostic> for Diagnostic
impl PartialEq<Diagnostic> for Diagnostic
source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.