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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.