TokenStream

Struct TokenStream 

Source
pub struct TokenStream(/* private fields */);
Expand description

Wrapper around the proc_macro2 TokenStream.

Trait Implementations§

Source§

impl From<TokenStream> for TokenStream

Source§

fn from(value: TokenStream) -> Self

Converts to this type from the input type.
Source§

impl Group<TokenStream> for Group

Source§

fn delimiter(&self) -> Delimiter

Returns the delimiter of this Group.
Source§

fn stream(&self) -> TokenStream

Returns the TokenStream of tokens that are delimited in this Group. Note that the returned token stream does not include the delimiter returned above.
Source§

impl Into<TokenStream> for TokenStream

Source§

fn into(self) -> TokenStream

Converts this type into the (usually inferred) input type.
Source§

impl IntoIterator for TokenStream

Source§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
Source§

type Item = TokenTree<TokenStream>

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl TokenStream for TokenStream

Source§

type Group = Group

A delimited token stream.
Source§

type Ident = Ident

An identifier.
Source§

type Literal = Literal

A literal string ("hello"), byte string (b"hello"), character ('a'), byte character (b'a'), an integer or floating point number with or without a suffix (1, 1u8, 2.3, 2.3f32). Boolean literals like true and false do not belong here, they are Idents.
Source§

type Punct = Punct

An Punct is a single punctuation character like +, - or #.
Source§

type Span = Span

A region of source code, along with macro expansion information.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoTokenStream for T
where T: TokenStream,

Source§

type TokenStream = T

This is the type of token stream that this trait converts into.
Source§

fn into_token_stream(self) -> <T as IntoTokenStream>::TokenStream

Converts this type into a token stream.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.