Enum syntax::ext::tt::quoted::TokenTree[][src]

pub enum TokenTree {
    Token(SpanToken),
    Delimited(SpanLrc<Delimited>),
    Sequence(SpanLrc<SequenceRepetition>),
    MetaVar(SpanIdent),
    MetaVarDecl(SpanIdentIdent),
}
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Similar to tokenstream::TokenTree, except that $i, $i:ident, and $(...) are "first-class" token trees. Useful for parsing macros.

Variants

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

A kleene-style repetition sequence

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

E.g. $var

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

E.g. $var:expr. This is only used in the left hand side of MBE macros.

Methods

impl TokenTree
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Return the number of tokens in the tree.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Returns true if the given token tree contains no other tokens. This is vacuously true for single tokens or metavar/decls, but may be false for delimited trees or sequences.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Get the index-th sub-token-tree. This only makes sense for delimited trees and sequences.

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Retrieve the TokenTree's span.

Trait Implementations

impl Debug for TokenTree
[src]

Formats the value using the given formatter. Read more

impl Clone for TokenTree
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for TokenTree
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Encodable for TokenTree
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

impl Decodable for TokenTree
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Auto Trait Implementations

impl !Send for TokenTree

impl !Sync for TokenTree