Enum proc_macro::TokenTree[][src]

pub enum TokenTree {
    Group(Group),
    Term(Term),
    Op(Op),
    Literal(Literal),
}
🔬 This is a nightly-only experimental API. (proc_macro #38356)

A single token or a delimited sequence of token trees (e.g. [1, (), ..]).

Variants

🔬 This is a nightly-only experimental API. (proc_macro #38356)

A delimited tokenstream

🔬 This is a nightly-only experimental API. (proc_macro #38356)

A unicode identifier

🔬 This is a nightly-only experimental API. (proc_macro #38356)

A punctuation character (+, ,, $, etc.).

🔬 This is a nightly-only experimental API. (proc_macro #38356)

A literal character ('a'), string ("hello"), number (2.3), etc.

Methods

impl TokenTree
[src]

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Returns the span of this token, accessing the span method of each of the internal tokens.

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Configures the span for only this token.

Note that if this token is a Group then this method will not configure the span of each of the internal tokens, this will simply delegate to the set_span method of each variant.

Trait Implementations

impl From<TokenTree> for TokenStream
[src]

Performs the conversion.

impl FromIterator<TokenTree> for TokenStream
[src]

Creates a value from an iterator. Read more

impl Clone for TokenTree
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl !Send for TokenTree
[src]

impl !Sync for TokenTree
[src]

impl Debug for TokenTree
[src]

Formats the value using the given formatter. Read more

impl From<Group> for TokenTree
[src]

Performs the conversion.

impl From<Term> for TokenTree
[src]

Performs the conversion.

impl From<Op> for TokenTree
[src]

Performs the conversion.

impl From<Literal> for TokenTree
[src]

Performs the conversion.

impl Display for TokenTree
[src]

Formats the value using the given formatter. Read more