[−][src]Struct rustc_ap_rustc_ast::tokenstream::TokenStream
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
backwards compatability.
Implementations
impl TokenStream
[src]
pub fn add_comma(&self) -> Option<(TokenStream, Span)>
[src]
Given a TokenStream
with a Stream
of only two arguments, return a new TokenStream
separating the two arguments with a comma for diagnostic suggestions.
impl TokenStream
[src]
pub fn new(streams: Vec<TreeAndSpacing>) -> TokenStream
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn len(&self) -> usize
[src]
pub fn span(&self) -> Option<Span>
[src]
pub fn from_streams(mut streams: SmallVec<[TokenStream; 2]>) -> TokenStream
[src]
pub fn trees_ref(&self) -> CursorRef<'_>ⓘ
[src]
pub fn trees(&self) -> Cursorⓘ
[src]
pub fn into_trees(self) -> Cursorⓘ
[src]
pub fn eq_unspanned(&self, other: &TokenStream) -> bool
[src]
Compares two TokenStream
s, checking equality without regarding span information.
pub fn map_enumerated<F: FnMut(usize, &TokenTree) -> TokenTree>(
self,
mut f: F
) -> TokenStream
[src]
self,
mut f: F
) -> TokenStream
Trait Implementations
impl Clone for TokenStream
[src]
pub fn clone(&self) -> TokenStream
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl CreateTokenStream for TokenStream
[src]
pub fn add_trailing_semi(&self) -> Box<dyn CreateTokenStream>
[src]
pub fn create_token_stream(&self) -> TokenStream
[src]
impl Debug for TokenStream
[src]
impl<__D: Decoder> Decodable<__D> for TokenStream
[src]
impl Default for TokenStream
[src]
pub fn default() -> TokenStream
[src]
impl<__E: Encoder> Encodable<__E> for TokenStream
[src]
impl Eq for TokenStream
[src]
impl From<TokenTree> for TokenStream
[src]
pub fn from(tree: TokenTree) -> TokenStream
[src]
impl FromIterator<TokenTree> for TokenStream
[src]
pub fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self
[src]
impl<CTX> HashStable<CTX> for TokenStream where
CTX: HashStableContext,
[src]
CTX: HashStableContext,
pub fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher)
[src]
impl PartialEq<TokenStream> for TokenStream
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TokenStream
[src]
impl !Send for TokenStream
[src]
impl !Sync for TokenStream
[src]
impl Unpin for TokenStream
[src]
impl !UnwindSafe for TokenStream
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,