[][src]Struct proc_macro2_diagnostics::Diagnostic

pub struct Diagnostic { /* fields omitted */ }

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]

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]

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]

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]

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]

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]

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]

impl Debug for Diagnostic[src]

impl From<Diagnostic> for Error[src]

impl From<Diagnostic> for Diagnostic[src]

impl From<Error> for Diagnostic[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.