Struct syntex_syntax::tokenstream::TokenStream
[−]
[src]
pub struct TokenStream { /* fields omitted */ }
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
fn is_empty(&self) -> bool
fn concat(streams: Vec<TokenStream>) -> TokenStream
fn trees(&self) -> Cursor
fn into_trees(self) -> Cursor
fn eq_unspanned(&self, other: &TokenStream) -> bool
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 From<Token> for TokenStream
[src]
fn from(token: Token) -> 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 Serialize for TokenStream
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for TokenStream
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more