pub struct Diagnostic { /* private fields */ }
proc_macro_diagnostic
#54140)Expand description
A structure representing a diagnostic message and associated children messages.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)Creates a new diagnostic with the given level
and message
.
Sourcepub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn error<T: Into<String>>(self, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn warning<T: Into<String>>(self, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn note<T: Into<String>>(self, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn help<T: Into<String>>(self, message: T) -> Diagnostic
proc_macro_diagnostic
#54140)Adds a new child diagnostic message to self
with the Level::Help
level, and the given message
.
Sourcepub fn level(&self) -> Level
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn level(&self) -> Level
proc_macro_diagnostic
#54140)Returns the diagnostic level
for self
.
Sourcepub fn set_level(&mut self, level: Level)
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn set_level(&mut self, level: Level)
proc_macro_diagnostic
#54140)Sets the level in self
to level
.
Sourcepub fn message(&self) -> &str
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn message(&self) -> &str
proc_macro_diagnostic
#54140)Returns the message in self
.
Sourcepub fn set_message<T: Into<String>>(&mut self, message: T)
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn set_message<T: Into<String>>(&mut self, message: T)
proc_macro_diagnostic
#54140)Sets the message in self
to message
.
Sourcepub fn spans(&self) -> &[Span]
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn spans(&self) -> &[Span]
proc_macro_diagnostic
#54140)Returns the Span
s in self
.
Sourcepub fn set_spans<S: MultiSpan>(&mut self, spans: S)
🔬This is a nightly-only experimental API. (proc_macro_diagnostic
#54140)
pub fn set_spans<S: MultiSpan>(&mut self, spans: S)
proc_macro_diagnostic
#54140)Sets the Span
s in self
to spans
.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more