Trait ToTokens

Source
pub trait ToTokens {
    // Required method
    fn to_tokens(&self, tokens: &mut TokenStream);

    // Provided methods
    fn to_token_stream(&self) -> TokenStream { ... }
    fn into_token_stream(self) -> TokenStream
       where Self: Sized { ... }
}
Expand description

A trait for converting types into a TokenStream.

See the module documentation for more information.

Required Methods§

Source

fn to_tokens(&self, tokens: &mut TokenStream)

Append self to the given TokenStream.

Provided Methods§

Source

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream.

Source

fn into_token_stream(self) -> TokenStream
where Self: Sized,

Convert self directly into a TokenStream.

Implementations on Foreign Types§

Source§

impl ToTokens for f32

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for f64

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for i8

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for i16

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for i32

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for i64

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for i128

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for isize

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for str

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for u8

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for u16

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for u32

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for u64

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for u128

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for usize

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for String

Source§

fn to_tokens(&self, tokens: &mut TokenStream)

Source§

impl ToTokens for TokenStream

Available on crate feature proc-macro2 only.
Source§

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T

Source§

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T

Source§

impl<T: ToTokens> ToTokens for Option<T>

Implementors§

Source§

impl ToTokens for flexi_parse::TokenStream

Source§

impl ToTokens for Ampersand

Source§

impl ToTokens for AmpersandAmpersand

Source§

impl ToTokens for Asterisk

Source§

impl ToTokens for AsteriskEqual

Source§

impl ToTokens for At

Source§

impl ToTokens for BackTick

Source§

impl ToTokens for Backslash

Source§

impl ToTokens for Bang

Source§

impl ToTokens for BangEqual

Source§

impl ToTokens for Caret

Source§

impl ToTokens for CarriageReturn

Source§

impl ToTokens for Colon

Source§

impl ToTokens for ColonColon

Source§

impl ToTokens for ColonColonEqual

Source§

impl ToTokens for Comma

Source§

impl ToTokens for Dash

Source§

impl ToTokens for DashDash

Source§

impl ToTokens for DashEqual

Source§

impl ToTokens for Dollar

Source§

impl ToTokens for Dot

Source§

impl ToTokens for DoubleQuote

Source§

impl ToTokens for Equal

Source§

impl ToTokens for EqualEqual

Source§

impl ToTokens for FatArrow

Source§

impl ToTokens for Hash

Source§

impl ToTokens for HashHash

Source§

impl ToTokens for HashHashHash

Source§

impl ToTokens for Ident

Source§

impl ToTokens for LAngle

Source§

impl ToTokens for LAngleEqual

Source§

impl ToTokens for LAngleLAngle

Source§

impl ToTokens for LAngleLAngleEqual

Source§

impl ToTokens for LThinArrow

Source§

impl ToTokens for LeftBrace

Source§

impl ToTokens for LeftBracket

Source§

impl ToTokens for LeftParen

Source§

impl ToTokens for LitChar

Source§

impl ToTokens for LitFloat

Source§

impl ToTokens for LitInt

Source§

impl ToTokens for LitStrDoubleQuote

Source§

impl ToTokens for LitStrSingleQuote

Source§

impl ToTokens for NewLine

Source§

impl ToTokens for Percent

Source§

impl ToTokens for PercentEqual

Source§

impl ToTokens for Pipe

Source§

impl ToTokens for PipePipe

Source§

impl ToTokens for Plus

Source§

impl ToTokens for PlusEqual

Source§

impl ToTokens for PlusPlus

Source§

impl ToTokens for Pound

Source§

impl ToTokens for Question

Source§

impl ToTokens for RAngle

Source§

impl ToTokens for RAngleEqual

Source§

impl ToTokens for RAngleRAngle

Source§

impl ToTokens for RAngleRAngleEqual

Source§

impl ToTokens for RThinArrow

Source§

impl ToTokens for RightBrace

Source§

impl ToTokens for RightBracket

Source§

impl ToTokens for RightParen

Source§

impl ToTokens for SemiColon

Source§

impl ToTokens for SingleQuote

Source§

impl ToTokens for Slash

Source§

impl ToTokens for SlashEqual

Source§

impl ToTokens for SlashSlash

Source§

impl ToTokens for SlashSlashEqual

Source§

impl ToTokens for Space2

Source§

impl ToTokens for Space4

Source§

impl ToTokens for Tab

Source§

impl ToTokens for Tilde2

Source§

impl ToTokens for Tilde

Source§

impl ToTokens for UnderScore