Struct syntax::tokenstream::TokenStream
[−]
[src]
pub struct TokenStream { /* fields omitted */ }
rustc_private
)Token Streams
A TokenStream
is an abstract sequence of tokens, organized into TokenTree
s.
The goal is for procedural macros to work with TokenStream
s and TokenTree
s
instead of a representation of the abstract syntax tree.
Today's TokenTree
s can still contain AST via Token::Interpolated
for back-compat.
Methods
impl TokenStream
[src]
fn empty() -> TokenStream
rustc_private
)fn is_empty(&self) -> bool
rustc_private
)fn concat(streams: Vec<TokenStream>) -> TokenStream
rustc_private
)fn trees(&self) -> Cursor
rustc_private
)fn into_trees(self) -> Cursor
rustc_private
)fn eq_unspanned(&self, other: &TokenStream) -> bool
rustc_private
)Compares two TokenStreams, checking equality without regarding span information.
Trait Implementations
impl Clone for TokenStream
[src]
fn clone(&self) -> TokenStream
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for TokenStream
[src]
impl From<TokenTree> for TokenStream
[src]
fn from(tt: TokenTree) -> TokenStream
Performs the conversion.
impl<T: Into<TokenStream>> FromIterator<T> for TokenStream
[src]
fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl Eq for TokenStream
[src]
impl PartialEq<TokenStream> for TokenStream
[src]
fn eq(&self, other: &TokenStream) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl From<ThinTokenStream> for TokenStream
[src]
fn from(stream: ThinTokenStream) -> TokenStream
Performs the conversion.
impl Display for TokenStream
[src]
impl Encodable for TokenStream
[src]
fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), E::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for TokenStream
[src]
fn decode<D: Decoder>(decoder: &mut D) -> Result<TokenStream, D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl Hash for TokenStream
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.