#[non_exhaustive]pub struct Diagnostic {
pub level: Level,
pub locale: String,
pub file: PathBuf,
pub line: u32,
pub column: u32,
pub id: Option<String>,
pub lint: Option<Lint>,
pub kind: Option<ErrorKind>,
pub message: String,
}Expand description
One thing a build has to say.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.level: LevelWhether it fails the build.
locale: StringThe locale it was found in.
file: PathBufThe file.
line: u32One-based line.
column: u32One-based column, in characters.
id: Option<String>The message’s id, where there is one.
lint: Option<Lint>Which lint; None for a syntax or data-model error, which is not a
lint but the message being wrong.
kind: Option<ErrorKind>The MF2 error kind, for a diagnostic that is one — a syntax or
data-model error. It is what the WG suite names the error, so a
consumer can check the build’s verdict without reading prose:
conformance layer L5 does, and --format json carries it.
message: StringWhat is wrong.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn write_text(&self, out: &mut String)
pub fn write_text(&self, out: &mut String)
The one-line form: file:line:column: level: message [lint].
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
Source§impl Serialize for Diagnostic
impl Serialize 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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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