Struct proc_macro::Diagnostic
source · [−]pub struct Diagnostic { /* private fields */ }Expand description
A structure representing a diagnostic message and associated children messages.
Implementations
sourceimpl Diagnostic
impl Diagnostic
sourcepub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
Creates a new diagnostic with the given level and message.
sourcepub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
pub 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.
sourcepub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
pub fn span_error<S, T>(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.
sourcepub fn error<T: Into<String>>(self, message: T) -> Diagnostic
pub fn error<T: Into<String>>(self, message: T) -> Diagnostic
Adds a new child diagnostic message to self with the Level::Error level, and the given message.
sourcepub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
pub fn span_warning<S, T>(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.
sourcepub fn warning<T: Into<String>>(self, message: T) -> Diagnostic
pub fn warning<T: Into<String>>(self, message: T) -> Diagnostic
Adds a new child diagnostic message to self with the Level::Warning level, and the given message.
sourcepub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
pub fn span_note<S, T>(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.
sourcepub fn note<T: Into<String>>(self, message: T) -> Diagnostic
pub fn note<T: Into<String>>(self, message: T) -> Diagnostic
Adds a new child diagnostic message to self with the Level::Note level, and the given message.
sourcepub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
pub fn span_help<S, T>(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.
sourcepub fn help<T: Into<String>>(self, message: T) -> Diagnostic
pub fn help<T: Into<String>>(self, message: T) -> Diagnostic
Adds a new child diagnostic message to self with the Level::Help level, and the given message.
sourcepub fn set_message<T: Into<String>>(&mut self, message: T)
pub fn set_message<T: Into<String>>(&mut self, message: T)
Sets the message in self to message.
Trait Implementations
sourceimpl Clone for Diagnostic
impl Clone for Diagnostic
sourcefn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for Diagnostic
impl !Send for Diagnostic
impl !Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more