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 Span
s 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 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 moreAuto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl !Send for Diagnostic
impl !Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more