Struct virtue::prelude::Diagnostic
source · pub struct Diagnostic { /* private fields */ }proc_macro_diagnostic)Expand description
A structure representing a diagnostic message and associated children messages.
Implementations§
source§impl Diagnostic
impl Diagnostic
sourcepub fn new<T>(level: Level, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn new<T>(level: Level, message: T) -> Diagnostic
proc_macro_diagnostic)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)
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic
proc_macro_diagnostic)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)
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic)Adds a new child diagnostics message to self with the Level::Error level, and the given spans and message.
sourcepub fn error<T>(self, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn error<T>(self, message: T) -> Diagnostic
proc_macro_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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic)Adds a new child diagnostics message to self with the Level::Warning level, and the given spans and message.
sourcepub fn warning<T>(self, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn warning<T>(self, message: T) -> Diagnostic
proc_macro_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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic)Adds a new child diagnostics message to self with the Level::Note level, and the given spans and message.
sourcepub fn note<T>(self, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn note<T>(self, message: T) -> Diagnostic
proc_macro_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
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic
proc_macro_diagnostic)Adds a new child diagnostics message to self with the Level::Help level, and the given spans and message.
sourcepub fn help<T>(self, message: T) -> Diagnostic
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn help<T>(self, message: T) -> Diagnostic
proc_macro_diagnostic)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)
pub fn level(&self) -> Level
proc_macro_diagnostic)Returns the diagnostic level for self.
sourcepub fn set_level(&mut self, level: Level)
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn set_level(&mut self, level: Level)
proc_macro_diagnostic)Sets the level in self to level.
sourcepub fn message(&self) -> &str
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn message(&self) -> &str
proc_macro_diagnostic)Returns the message in self.
sourcepub fn set_message<T>(&mut self, message: T)
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn set_message<T>(&mut self, message: T)
proc_macro_diagnostic)Sets the message in self to message.
sourcepub fn spans(&self) -> &[Span]
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn spans(&self) -> &[Span]
proc_macro_diagnostic)Returns the Spans in self.
sourcepub fn set_spans<S>(&mut self, spans: S)where
S: MultiSpan,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic)
pub fn set_spans<S>(&mut self, spans: S)where
S: MultiSpan,
proc_macro_diagnostic)Sets the Spans 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