#[derive(Deserialize, Debug)]
pub struct Diagnostic {
pub message: String,
pub code: Option<DiagnosticCode>,
level: String,
pub spans: Vec<DiagnosticSpan>,
pub children: Vec<Diagnostic>,
rendered: Option<String>,
}
#[derive(Deserialize, Debug)]
pub struct DiagnosticSpan {
pub file_name: String,
pub byte_start: u32,
pub byte_end: u32,
pub line_start: usize,
pub line_end: usize,
pub column_start: usize,
pub column_end: usize,
is_primary: bool,
pub text: Vec<DiagnosticSpanLine>,
label: Option<String>,
pub suggested_replacement: Option<String>,
expansion: Option<Box<DiagnosticSpanMacroExpansion>>,
}
#[derive(Deserialize, Debug)]
pub struct DiagnosticSpanLine {
pub text: String,
pub highlight_start: usize,
pub highlight_end: usize,
}
#[derive(Deserialize, Debug)]
struct DiagnosticSpanMacroExpansion {
span: DiagnosticSpan,
macro_decl_name: String,
def_site_span: Option<DiagnosticSpan>,
}
#[derive(Deserialize, Debug)]
pub struct DiagnosticCode {
pub code: String,
explanation: Option<String>,
}