pub struct Diagnostic {
pub severity: Severity,
pub span: Span,
pub message: String,
pub hint: Option<String>,
pub source_line: Option<String>,
}Expand description
A single diagnostic message with source context.
Fields§
§severity: SeverityError or warning.
span: SpanWhere in the source.
message: StringThe message.
hint: Option<String>A suggested fix, if any.
source_line: Option<String>The source line text (for display).
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn with_source_line(self, line: impl Into<String>) -> Self
pub fn with_source_line(self, line: impl Into<String>) -> Self
The same diagnostic with the source line shown under it.
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 moreSource§impl Debug for Diagnostic
impl Debug 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