Enum syntax::ext::tt::quoted::TokenTree
[−]
[src]
pub enum TokenTree { Token(Span, Token), Delimited(Span, Lrc<Delimited>), Sequence(Span, Lrc<SequenceRepetition>), MetaVar(Span, Ident), MetaVarDecl(Span, Ident, Ident), }
🔬 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
Token(Span, Token)
🔬 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?
Delimited(Span, Lrc<Delimited>)
🔬 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?
Sequence(Span, Lrc<SequenceRepetition>)
🔬 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
MetaVar(Span, Ident)
🔬 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
MetaVarDecl(Span, Ident, Ident)
🔬 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]
impl TokenTree
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
🔬 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.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
🔬 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.
pub fn get_tt(&self, index: usize) -> TokenTree
[src]
pub fn get_tt(&self, index: usize) -> TokenTree
🔬 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.
pub fn span(&self) -> Span
[src]
pub fn span(&self) -> Span
🔬 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]
impl Debug for TokenTree
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for TokenTree
[src]
impl Clone for TokenTree
fn clone(&self) -> TokenTree
[src]
fn clone(&self) -> TokenTree
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for TokenTree
[src]
impl PartialEq for TokenTree
fn eq(&self, __arg_0: &TokenTree) -> bool
[src]
fn eq(&self, __arg_0: &TokenTree) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &TokenTree) -> bool
[src]
fn ne(&self, __arg_0: &TokenTree) -> bool
This method tests for !=
.
impl Eq for TokenTree
[src]
impl Eq for TokenTree
impl Encodable for TokenTree
[src]
impl Encodable for TokenTree
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 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]
impl Decodable for TokenTree
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<TokenTree, __D::Error>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<TokenTree, __D::Error>
🔬 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 Hash for TokenTree
[src]
impl Hash for TokenTree