pub struct Diagnostic {
pub code: String,
pub severity: Severity,
pub message: String,
pub file: Option<String>,
pub line: Option<usize>,
pub span: Option<(usize, usize)>,
pub help: Option<String>,
}Expand description
One located finding. No fix field: an edit needs a span, and no written literal carries one.
Fields§
§code: String§severity: Severity§message: String§file: Option<String>§line: Option<usize>§span: Option<(usize, usize)>§help: Option<String>Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn new(code: impl Into<String>, message: impl Into<String>) -> Diagnostic
pub fn at( self, file: Option<String>, span: Option<(usize, usize)>, ) -> Diagnostic
pub fn helped(self, help: impl Into<String>) -> Diagnostic
pub fn on_line(self, line: Option<usize>) -> Diagnostic
pub fn with_severity(self, severity: Severity) -> Diagnostic
Auto 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