Struct TokenStream
struct TokenStream { ... }
An abstract stream of tokens, or more concretely a sequence of token trees.
This type provides interfaces for iterating over token trees and for collecting token trees into one stream.
Token stream is both the input and output of #[proc_macro],
#[proc_macro_attribute] and #[proc_macro_derive] definitions.
Implementations
impl TokenStream
fn new() -> SelfReturns an empty
TokenStreamcontaining no token trees.fn is_empty(self: &Self) -> boolChecks if this
TokenStreamis empty.
impl Clone for TokenStream
fn clone(self: &Self) -> TokenStream
impl Debug for TokenStream
fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for TokenStream
fn default() -> Self
impl Display for TokenStream
fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Extend for TokenStream
fn extend<I: IntoIterator<Item = TokenStream>>(self: &mut Self, streams: I)
impl Extend for TokenStream
fn extend<I: IntoIterator<Item = TokenTree>>(self: &mut Self, streams: I)
impl Freeze for TokenStream
impl From for TokenStream
fn from(inner: proc_macro::TokenStream) -> Self
impl From for TokenStream
fn from(token: TokenTree) -> Self
impl FromIterator for TokenStream
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self
impl FromIterator for TokenStream
fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self
impl FromStr for TokenStream
fn from_str(src: &str) -> Result<TokenStream, LexError>
impl IntoIterator for TokenStream
fn into_iter(self: Self) -> IntoIter
impl RefUnwindSafe for TokenStream
impl Send for TokenStream
impl Sync for TokenStream
impl Unpin for TokenStream
impl UnwindSafe for TokenStream
impl<T> Any for TokenStream
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for TokenStream
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for TokenStream
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for TokenStream
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for TokenStream
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for TokenStream
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for TokenStream
fn to_string(self: &Self) -> String
impl<T, U> Into for TokenStream
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for TokenStream
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for TokenStream
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>