Struct Diagnostic
pub struct Diagnostic { pub(in ::diagnostic) level: Level, pub(in ::diagnostic) message: String, pub(in ::diagnostic) spans: Vec<Span>, pub(in ::diagnostic) children: Vec<Diagnostic> }
A structure representing a diagnostic message and associated children messages.
Fields
level: Levelmessage: Stringspans: Vec<Span>children: Vec<Diagnostic>
Implementations
impl Diagnostic
fn new<T: Into<String>>(level: Level, message: T) -> DiagnosticCreates a new diagnostic with the given
levelandmessage.fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where S: MultiSpan, T: Into<String>,Creates a new diagnostic with the given
levelandmessagepointing to the given set ofspans.fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic where S: MultiSpan, T: Into<String>,Adds a new child diagnostics message to
selfwith theLevel::Errorlevel, and the givenspansandmessage.fn error<T: Into<String>>(self, message: T) -> DiagnosticAdds a new child diagnostic message to
selfwith theLevel::Errorlevel, and the givenmessage.fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic where S: MultiSpan, T: Into<String>,Adds a new child diagnostics message to
selfwith theLevel::Warninglevel, and the givenspansandmessage.fn warning<T: Into<String>>(self, message: T) -> DiagnosticAdds a new child diagnostic message to
selfwith theLevel::Warninglevel, and the givenmessage.fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic where S: MultiSpan, T: Into<String>,Adds a new child diagnostics message to
selfwith theLevel::Notelevel, and the givenspansandmessage.fn note<T: Into<String>>(self, message: T) -> DiagnosticAdds a new child diagnostic message to
selfwith theLevel::Notelevel, and the givenmessage.fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic where S: MultiSpan, T: Into<String>,Adds a new child diagnostics message to
selfwith theLevel::Helplevel, and the givenspansandmessage.fn help<T: Into<String>>(self, message: T) -> DiagnosticAdds a new child diagnostic message to
selfwith theLevel::Helplevel, and the givenmessage.fn level(&self) -> LevelReturns the diagnostic
levelforself.fn set_level(&mut self, level: Level)Sets the level in
selftolevel.fn message(&self) -> &strReturns the message in
self.fn set_message<T: Into<String>>(&mut self, message: T)Sets the message in
selftomessage.fn spans(&self) -> &[Span]Returns the
Spans inself.fn set_spans<S: MultiSpan>(&mut self, spans: S)Sets the
Spans inselftospans.fn children(&self) -> Children<'_>Returns an iterator over the children diagnostics of
self.fn emit(self)Emit the diagnostic.
Trait Implementations
impl Clone for Diagnostic
fn clone(&self) -> Diagnostic
impl Debug for Diagnostic
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl !Send for Diagnostic
impl !Sync for Diagnostic
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations
impl<T> Any for Diagnostic
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Diagnostic
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Diagnostic
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Diagnostic
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Diagnostic
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for Diagnostic
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for Diagnostic
impl<T> ToOwned for Diagnostic
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Diagnostic
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Diagnostic
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Diagnostic
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>