pub struct Diagnostic {
pub file: Option<PathBuf>,
pub line: Option<usize>,
pub column: Option<usize>,
pub severity: Severity,
pub message: String,
pub producer: Producer,
pub raw: String,
}Expand description
One parsed message from a build tool.
Fields§
§file: Option<PathBuf>The file the message refers to, when it names one.
line: Option<usize>The one-based line number, when the message carries one.
column: Option<usize>The one-based column, when the message carries one.
severity: SeverityHow serious the message is.
message: StringThe message text, with the location prefix removed.
producer: ProducerWhich tool produced it.
raw: StringThe original line, kept so the raw output can always be shown.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn has_location(&self) -> bool
pub fn has_location(&self) -> bool
Whether the diagnostic can be navigated to.
Sourcepub fn buffer_line(&self) -> Option<usize>
pub fn buffer_line(&self) -> Option<usize>
The zero-based line index, for addressing a buffer.
Tools report one-based lines; buffers are zero-based. Converting in one place avoids an off-by-one at every call site.
Sourcepub fn buffer_column(&self) -> usize
pub fn buffer_column(&self) -> usize
The zero-based column index, for addressing a buffer.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§impl Debug for Diagnostic
impl Debug 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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