pub trait TokenTree: ProcMacro<TokenTree = Self> + Display + From<Self::Group> + From<Self::Ident> + From<Self::Punct> + From<Self::Literal> {
// Required methods
fn span(&self) -> Self::Span;
fn set_span(&mut self, span: Self::Span);
}Expand description
TokenTree API trait. See proc_macro::TokenTree.
This trait is implemented for TokenTree in proc_macro and proc_macro2 if the
corresponding feature is enabled.
See also TokenTreeExt.
Required Methods§
sourcefn set_span(&mut self, span: Self::Span)
fn set_span(&mut self, span: Self::Span)
Set the span of this TokenTree. If the TokenTree is a Group, this will use Group::set_span.
Object Safety§
This trait is not object safe.