[−][src]Struct proc_macro2_diagnostics::Diagnostic
A structure representing a diagnostic message and associated children messages.
Implementations
impl Diagnostic
[src]
pub fn new<T: Into<String>>(level: Level, message: T) -> Diagnostic
[src]
Creates a new diagnostic with the given level
and message
.
pub fn spanned<S, T>(spans: S, level: Level, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
S: MultiSpan,
T: Into<String>,
Creates a new diagnostic with the given level
and message
pointing
to the given set of spans
.
pub fn spanned_child<S, T>(
self,
spans: S,
level: Level,
message: T
) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
self,
spans: S,
level: Level,
message: T
) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
Adds a new child diagnostic message to self
with the level
and the
given spans
and message
.
pub fn child<T: Into<String>>(self, level: Level, message: T) -> Diagnostic
[src]
Adds a new child diagnostic message to self
with level
and the given
message
.
pub fn span_error<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
S: MultiSpan,
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given spans
and
message
.
pub fn error<T: Into<String>>(self, message: T) -> Diagnostic
[src]
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_warning<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
S: MultiSpan,
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given spans
and
message
.
pub fn warning<T: Into<String>>(self, message: T) -> Diagnostic
[src]
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_note<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
S: MultiSpan,
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given spans
and
message
.
pub fn note<T: Into<String>>(self, message: T) -> Diagnostic
[src]
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn span_help<S, T>(self, spans: S, message: T) -> Diagnostic where
S: MultiSpan,
T: Into<String>,
[src]
S: MultiSpan,
T: Into<String>,
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given spans
and
message
.
pub fn help<T: Into<String>>(self, message: T) -> Diagnostic
[src]
Adds a new child diagnostic message to self
with the level
identified by this method's name with the given message
.
pub fn children(&self) -> impl Iterator<Item = &Diagnostic>
[src]
Return the children diagnostics of self
.
pub fn level(&self) -> Level
[src]
Return the level
of self
.
pub fn emit_as_item_tokens(self) -> TokenStream
[src]
Emit tokens, suitable for item contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns an empty token stream.
pub fn emit_as_item_tokens_or(self, default: TokenStream) -> TokenStream
[src]
Emit tokens, suitable for item contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns default
.
pub fn emit_as_expr_tokens(self) -> TokenStream
[src]
Emit tokens, suitable for expression contexts, to generate a comple-time
diagnostic corresponding to self
. On nightly, this directly emits the
error and returns a ()
token stream.
pub fn emit_as_expr_tokens_or(self, default: TokenStream) -> TokenStream
[src]
Emit tokens, suitable for expressioon contexts, to generate a
comple-time diagnostic corresponding to self
. On nightly, this
directly emits the error and returns default
.
Trait Implementations
impl Clone for Diagnostic
[src]
fn clone(&self) -> Diagnostic
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Diagnostic
[src]
impl From<Diagnostic> for Error
[src]
fn from(diag: Diagnostic) -> Error
[src]
impl From<Diagnostic> for Diagnostic
[src]
fn from(diag: Diagnostic) -> Diagnostic
[src]
impl From<Error> for Diagnostic
[src]
fn from(error: Error) -> Diagnostic
[src]
Auto Trait Implementations
impl RefUnwindSafe for Diagnostic
impl !Send for Diagnostic
impl !Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,