#[non_exhaustive]pub struct Diagnostic {
pub rule: RuleId,
pub severity: Severity,
pub span: Span,
pub message: Box<str>,
pub citation: &'static str,
pub fix: Option<FixProposal>,
}Expand description
A single diagnostic emitted by a rule check.
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.rule: RuleId§severity: Severity§span: SpanByte span in the original source buffer.
message: Box<str>Human-readable description of the violation.
citation: &'static strCAPCO section citation, e.g., “CAPCO-2023-§3.1”.
fix: Option<FixProposal>Proposed fix, if the rule can generate one.
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 · 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