Struct proc_macro::Diagnostic
[−]
[src]
pub struct Diagnostic { /* fields omitted */ }
A structure representing a diagnostic message and associated children messages.
Methods
impl Diagnostic
[src]
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
[src][−]
Create a new diagnostic with the given level
and message
.
pub fn spanned<T: Into<String>>(
span: Span,
level: Level,
message: T
) -> Diagnostic
[src][−]
span: Span,
level: Level,
message: T
) -> Diagnostic
Create a new diagnostic with the given level
and message
pointing to
the given span
.
pub fn span_error<T: Into<String>>(self, span: Span, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this methods name with the given span
and message
.
pub fn error<T: Into<String>>(self, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_warning<T: Into<String>>(self, span: Span, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this methods name with the given span
and message
.
pub fn warning<T: Into<String>>(self, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_note<T: Into<String>>(self, span: Span, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this methods name with the given span
and message
.
pub fn note<T: Into<String>>(self, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_help<T: Into<String>>(self, span: Span, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this methods name with the given span
and message
.
pub fn help<T: Into<String>>(self, message: T) -> Diagnostic
[src][−]
Add a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn level(&self) -> Level
[src][−]
Returns the diagnostic level
for self
.
pub fn emit(self)
[src][−]
Emit the diagnostic.
Trait Implementations
impl Clone for Diagnostic
[src]
fn clone(&self) -> Diagnostic
[src][−]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src][−]
Performs copy-assignment from source
. Read more