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

pub enum TokenTree {
    Token(SpanToken),
    Delimited(SpanLrc<Delimited>),
    Sequence(SpanLrc<SequenceRepetition>),
    MetaVar(SpanIdent),
    MetaVarDecl(SpanIdentIdent),
}

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

Variants

A kleene-style repetition sequence

E.g. $var

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

Methods

impl TokenTree
[src]

Return the number of tokens in the tree.

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.

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

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 Eq for TokenTree
[src]

impl Encodable for TokenTree
[src]

impl Decodable for TokenTree
[src]

impl Hash for TokenTree
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl !Send for TokenTree

impl !Sync for TokenTree