Trait proclet::TokenTree

source ·
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§

source

fn span(&self) -> Self::Span

Get the span of this TokenTree.

source

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.

Implementations on Foreign Types§

source§

impl TokenTree for TokenTree

Available on crate feature proc-macro only.
source§

fn span(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

source§

impl TokenTree for TokenTree

Available on crate feature proc-macro2 only.
source§

fn span(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

Implementors§