pub struct Diagnostic {
pub severity: Severity,
pub kind: DiagnosticKind,
pub message: String,
pub span: Span,
pub help: Option<String>,
pub code: Option<String>,
pub fix: Option<FixHint>,
}Fields§
§severity: Severity§kind: DiagnosticKind§message: String§span: Span§help: Option<String>§code: Option<String>§fix: Option<FixHint>Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn error( kind: DiagnosticKind, message: impl Into<String>, span: Span, ) -> Self
pub fn with_help(self, help: impl Into<String>) -> Self
pub fn with_code(self, code: impl Into<String>) -> Self
pub fn with_fix(self, fix: FixHint) -> Self
pub fn format(&self, source: &str, file: &str) -> String
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§impl Debug for Diagnostic
impl Debug for Diagnostic
Source§impl Display for Diagnostic
impl Display for Diagnostic
impl Eq for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
impl StructuralPartialEq for 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