Struct proc_macro::Diagnostic
source · pub struct Diagnostic { /* private fields */ }proc_macro_diagnostic #54140)Expand description
表示诊断消息和关联的子消息的结构体。
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)使用给定的 level 和 message 创建新的诊断。
sourcepub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnosticwhere
S: MultiSpan,
T: Into<String>,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic #54140)
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnosticwhere S: MultiSpan, T: Into<String>,
proc_macro_diagnostic #54140)使用给定的 level 和 message 指向给定的 spans 集创建新的诊断。
sourcepub fn span_error<S, T>(self, spans: S, message: T) -> Diagnosticwhere
S: MultiSpan,
T: Into<String>,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic #54140)
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnosticwhere S: MultiSpan, T: Into<String>,
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) -> Diagnosticwhere
S: MultiSpan,
T: Into<String>,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic #54140)
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnosticwhere S: MultiSpan, T: Into<String>,
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) -> Diagnosticwhere
S: MultiSpan,
T: Into<String>,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic #54140)
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnosticwhere S: MultiSpan, T: Into<String>,
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) -> Diagnosticwhere
S: MultiSpan,
T: Into<String>,
🔬This is a nightly-only experimental API. (proc_macro_diagnostic #54140)
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnosticwhere S: MultiSpan, T: Into<String>,
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)返回 self 的诊断 level。
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)将 self 中的级别设置为 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)以 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)将 self 中的消息设置为 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)返回 self 中的 Span。
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)将 self 中的 Span 设置为 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