pub struct Diagnostic {
pub path: PathBuf,
pub line: usize,
pub column: usize,
pub severity: Severity,
pub code: &'static str,
pub message: String,
pub help: Option<String>,
pub labels: Vec<SourceLabel>,
pub notes: Vec<String>,
pub suggestions: Vec<Suggestion>,
}Fields§
§path: PathBuf§line: usize§column: usize§severity: Severity§code: &'static str§message: String§help: Option<String>§labels: Vec<SourceLabel>§notes: Vec<String>§suggestions: Vec<Suggestion>Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn new( path: impl AsRef<Path>, line: usize, column: usize, severity: Severity, code: &'static str, message: impl Into<String>, ) -> Self
pub fn with_help(self, help: impl Into<String>) -> Self
pub fn with_label(self, label: SourceLabel) -> Self
pub fn with_note(self, note: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: Suggestion) -> Self
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more