Struct Diagnostic

struct Diagnostic { ... }

A structure representing a diagnostic message and associated children messages.

Implementations

impl Diagnostic

fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic

Creates a new diagnostic with the given level and message.

fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
where
    S: MultiSpan,
    T: Into<String>

Creates a new diagnostic with the given level and message pointing to the given set of spans.

fn span_error<S, T>(self: Self, spans: S, message: T) -> Diagnostic
where
    S: MultiSpan,
    T: Into<String>

Adds a new child diagnostics message to self with the Level::Error level, and the given spans and message.

fn error<T: Into<String>>(self: Self, message: T) -> Diagnostic

Adds a new child diagnostic message to self with the Level::Error level, and the given message.

fn span_warning<S, T>(self: Self, spans: S, message: T) -> Diagnostic
where
    S: MultiSpan,
    T: Into<String>

Adds a new child diagnostics message to self with the Level::Warning level, and the given spans and message.

fn warning<T: Into<String>>(self: Self, message: T) -> Diagnostic

Adds a new child diagnostic message to self with the Level::Warning level, and the given message.

fn span_note<S, T>(self: Self, spans: S, message: T) -> Diagnostic
where
    S: MultiSpan,
    T: Into<String>

Adds a new child diagnostics message to self with the Level::Note level, and the given spans and message.

fn note<T: Into<String>>(self: Self, message: T) -> Diagnostic

Adds a new child diagnostic message to self with the Level::Note level, and the given message.

fn span_help<S, T>(self: Self, spans: S, message: T) -> Diagnostic
where
    S: MultiSpan,
    T: Into<String>

Adds a new child diagnostics message to self with the Level::Help level, and the given spans and message.

fn help<T: Into<String>>(self: Self, message: T) -> Diagnostic

Adds a new child diagnostic message to self with the Level::Help level, and the given message.

fn level(self: &Self) -> Level

Returns the diagnostic level for self.

fn set_level(self: &mut Self, level: Level)

Sets the level in self to level.

fn message(self: &Self) -> &str

Returns the message in self.

fn set_message<T: Into<String>>(self: &mut Self, message: T)

Sets the message in self to message.

fn spans(self: &Self) -> &[Span]

Returns the Spans in self.

fn set_spans<S: MultiSpan>(self: &mut Self, spans: S)

Sets the Spans in self to spans.

fn children(self: &Self) -> Children<'_>

Returns an iterator over the children diagnostics of self.

fn emit(self: Self)

Emit the diagnostic.

impl Clone for Diagnostic

fn clone(self: &Self) -> Diagnostic

impl Debug for Diagnostic

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

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

impl<T> Any for Diagnostic

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Diagnostic

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Diagnostic

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Diagnostic

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Diagnostic

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Diagnostic

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Diagnostic

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Diagnostic

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Diagnostic

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>