pub struct JsonDiagnostic {
pub code: String,
pub message: String,
pub severity: &'static str,
pub spans: Vec<JsonSpan>,
pub suggestions: Vec<JsonSuggestion>,
pub notes: Vec<String>,
pub helps: Vec<String>,
}Expand description
A diagnostic formatted for JSON output.
This structure is designed to be compatible with common editor protocols (LSP, cargo’s JSON format) while containing all information needed for rich diagnostic display.
Fields§
§code: StringError or warning code (e.g., “E0206”).
message: StringThe diagnostic message.
severity: &'static strSeverity level: “error” or “warning”.
spans: Vec<JsonSpan>Primary and secondary spans with labels.
suggestions: Vec<JsonSuggestion>Suggested fixes that can be applied.
notes: Vec<String>Additional notes providing context.
helps: Vec<String>Additional help messages.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonDiagnostic
impl RefUnwindSafe for JsonDiagnostic
impl Send for JsonDiagnostic
impl Sync for JsonDiagnostic
impl Unpin for JsonDiagnostic
impl UnwindSafe for JsonDiagnostic
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more