pub struct Diagnostic {
pub level: Level,
pub span: AbsoluteSpan,
pub message: String,
pub labels: Vec<DiagnosticLabel>,
pub children: Vec<Diagnostic>,
}Expand description
A diagnostic to be reported to the user.
Fields§
§level: LevelLevel of the message.
span: AbsoluteSpanMain location of the message.
message: StringMessage to be printed.
labels: Vec<DiagnosticLabel>Labels to be included.
Add labels with the label helper method.
children: Vec<Diagnostic>Child diagnostics.
Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn error<'db>( db: &'db dyn Db, span: Span<'db>, message: impl Display, ) -> Self
pub fn help<'db>( db: &'db dyn Db, span: Span<'db>, message: impl Display, ) -> Self
pub fn info<'db>( db: &'db dyn Db, span: Span<'db>, message: impl Display, ) -> Self
pub fn new<'db>( db: &'db dyn Db, level: Level, span: Span<'db>, message: impl Display, ) -> Self
pub fn report(self, db: &dyn Db) -> Reported
pub fn label( self, db: &dyn Db, level: Level, span: Span<'_>, message: impl Display, ) -> Self
pub fn child(self, child: Diagnostic) -> Self
pub fn render(&self, db: &dyn Db, opts: &RenderOptions) -> String
Trait Implementations§
Source§impl Accumulator for Diagnostic
impl Accumulator for Diagnostic
const DEBUG_NAME: &'static str = "Diagnostic"
Source§fn accumulate<Db>(self, db: &Db)where
Db: ?Sized + Database,
fn accumulate<Db>(self, db: &Db)where
Db: ?Sized + Database,
Accumulate an instance of this in the database for later retrieval.
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 · 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
Source§impl Hash for Diagnostic
impl Hash for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§impl Serialize for Diagnostic
impl Serialize for Diagnostic
impl Eq 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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