#[non_exhaustive]pub struct Diagnostic {
pub span: Range<u32>,
pub severity: Severity,
pub message: String,
pub code: Option<String>,
}Expand description
One compiler finding as published by the app’s debounced compile loop — the unified diagnostic type.
span is byte offsets into the revision-N snapshot the compile ran
against; it is stamped with that revision at DecorationStore::set_diagnostics
so a stale set is dropped rather than mis-placed. #[non_exhaustive] so
future fields (related spans, fix-its) don’t break construction sites.
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.span: Range<u32>Byte span into the revision this diagnostic was computed against.
severity: SeveritySeverity — render color and render-order key.
message: StringHuman-readable message.
code: Option<String>The compiler’s diagnostic code, if any.
Implementations§
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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