rune::macros

Trait ToTokens

Source
pub trait ToTokens {
    // Required method
    fn to_tokens(
        &self,
        cx: &mut MacroContext<'_, '_, '_>,
        stream: &mut TokenStream,
    ) -> Result<()>;
}
Expand description

Trait for things that can be turned into tokens.

Required Methods§

Source

fn to_tokens( &self, cx: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>

Turn the current item into tokens.

Implementations on Foreign Types§

Source§

impl<A, B> ToTokens for (A, B)
where A: ToTokens, B: ToTokens,

Source§

fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>

Source§

impl<A, B, C> ToTokens for (A, B, C)
where A: ToTokens, B: ToTokens, C: ToTokens,

Source§

fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>

Source§

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

Source§

fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>

Source§

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

Source§

fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>

Implementors§

Source§

impl ToTokens for AttrStyle

Source§

impl ToTokens for BinOp

Source§

impl ToTokens for Condition

Source§

impl ToTokens for Expr

Source§

impl ToTokens for ExprClosureArgs

Source§

impl ToTokens for ExprField

Source§

impl ToTokens for ExprRangeLimits

Source§

impl ToTokens for ExprSelectBranch

Source§

impl ToTokens for Fields

Source§

impl ToTokens for FnArg

Source§

impl ToTokens for Item

Source§

impl ToTokens for ItemModBody

Source§

impl ToTokens for ItemUseSegment

Source§

impl ToTokens for Kind

Source§

impl ToTokens for Lit

Source§

impl ToTokens for ObjectIdent

Source§

impl ToTokens for ObjectKey

Source§

impl ToTokens for Pat

Source§

impl ToTokens for PathSegment

Source§

impl ToTokens for Stmt

Source§

impl ToTokens for UnOp

Source§

impl ToTokens for Visibility

Source§

impl ToTokens for Abstract

Source§

impl ToTokens for AlignOf

Source§

impl ToTokens for Amp

Source§

impl ToTokens for AmpAmp

Source§

impl ToTokens for AmpEq

Source§

impl ToTokens for Arrow

Source§

impl ToTokens for As

Source§

impl ToTokens for Async

Source§

impl ToTokens for At

Source§

impl ToTokens for Attribute

Source§

impl ToTokens for Await

Source§

impl ToTokens for Bang

Source§

impl ToTokens for BangEq

Source§

impl ToTokens for Become

Source§

impl ToTokens for Block

Source§

impl ToTokens for Break

Source§

impl ToTokens for Caret

Source§

impl ToTokens for CaretEq

Source§

impl ToTokens for CloseBrace

Source§

impl ToTokens for CloseBracket

Source§

impl ToTokens for CloseEmpty

Source§

impl ToTokens for CloseParen

Source§

impl ToTokens for Colon

Source§

impl ToTokens for ColonColon

Source§

impl ToTokens for Comma

Source§

impl ToTokens for Const

Source§

impl ToTokens for Continue

Source§

impl ToTokens for Crate

Source§

impl ToTokens for Dash

Source§

impl ToTokens for DashEq

Source§

impl ToTokens for Default

Source§

impl ToTokens for Div

Source§

impl ToTokens for Do

Source§

impl ToTokens for Dollar

Source§

impl ToTokens for Dot

Source§

impl ToTokens for DotDot

Source§

impl ToTokens for DotDotEq

Source§

impl ToTokens for Else

Source§

impl ToTokens for EmptyBlock

Source§

impl ToTokens for Enum

Source§

impl ToTokens for Eq

Source§

impl ToTokens for EqEq

Source§

impl ToTokens for ExprAssign

Source§

impl ToTokens for ExprAwait

Source§

impl ToTokens for ExprBinary

Source§

impl ToTokens for ExprBlock

Source§

impl ToTokens for ExprBreak

Source§

impl ToTokens for ExprCall

Source§

impl ToTokens for ExprClosure

Source§

impl ToTokens for ExprContinue

Source§

impl ToTokens for ExprDefaultBranch

Source§

impl ToTokens for ExprElse

Source§

impl ToTokens for ExprElseIf

Source§

impl ToTokens for ExprEmpty

Source§

impl ToTokens for ExprFieldAccess

Source§

impl ToTokens for ExprFor

Source§

impl ToTokens for ExprGroup

Source§

impl ToTokens for ExprIf

Source§

impl ToTokens for ExprIndex

Source§

impl ToTokens for ExprLet

Source§

impl ToTokens for ExprLit

Source§

impl ToTokens for ExprLoop

Source§

impl ToTokens for ExprMatch

Source§

impl ToTokens for ExprMatchBranch

Source§

impl ToTokens for ExprObject

Source§

impl ToTokens for ExprRange

Source§

impl ToTokens for ExprReturn

Source§

impl ToTokens for ExprSelect

Source§

impl ToTokens for ExprSelectPatBranch

Source§

impl ToTokens for ExprTry

Source§

impl ToTokens for ExprTuple

Source§

impl ToTokens for ExprUnary

Source§

impl ToTokens for ExprVec

Source§

impl ToTokens for ExprWhile

Source§

impl ToTokens for ExprYield

Source§

impl ToTokens for Extern

Source§

impl ToTokens for False

Source§

impl ToTokens for Field

Source§

impl ToTokens for FieldAssign

Source§

impl ToTokens for File

Source§

impl ToTokens for Final

Source§

impl ToTokens for Fn

Source§

impl ToTokens for For

Source§

impl ToTokens for Group

Source§

impl ToTokens for Gt

Source§

impl ToTokens for GtEq

Source§

impl ToTokens for GtGt

Source§

impl ToTokens for GtGtEq

Source§

impl ToTokens for Ident

Source§

impl ToTokens for If

Source§

impl ToTokens for Impl

Source§

impl ToTokens for In

Source§

impl ToTokens for Is

Source§

impl ToTokens for IsNot

Source§

impl ToTokens for ItemConst

Source§

impl ToTokens for ItemEnum

Source§

impl ToTokens for ItemFn

Source§

impl ToTokens for ItemImpl

Source§

impl ToTokens for ItemInlineBody

Source§

impl ToTokens for ItemMod

Source§

impl ToTokens for ItemStruct

Source§

impl ToTokens for ItemUse

Source§

impl ToTokens for ItemUsePath

Source§

impl ToTokens for ItemVariant

Source§

impl ToTokens for Label

Source§

impl ToTokens for Let

Source§

impl ToTokens for LitBool

Source§

impl ToTokens for LitByte

Source§

impl ToTokens for LitByteStr

Source§

impl ToTokens for LitChar

Source§

impl ToTokens for LitNumber

Source§

impl ToTokens for LitStr

Source§

impl ToTokens for Local

Source§

impl ToTokens for Loop

Source§

impl ToTokens for Lt

Source§

impl ToTokens for LtEq

Source§

impl ToTokens for LtLt

Source§

impl ToTokens for LtLtEq

Source§

impl ToTokens for Macro

Source§

impl ToTokens for MacroCall

Source§

impl ToTokens for Match

Source§

impl ToTokens for Mod

Source§

impl ToTokens for Move

Source§

impl ToTokens for Mut

Source§

impl ToTokens for Not

Source§

impl ToTokens for OffsetOf

Source§

impl ToTokens for OpenBrace

Source§

impl ToTokens for OpenBracket

Source§

impl ToTokens for OpenEmpty

Source§

impl ToTokens for OpenParen

Source§

impl ToTokens for Override

Source§

impl ToTokens for PatBinding

Source§

impl ToTokens for PatIgnore

Source§

impl ToTokens for PatLit

Source§

impl ToTokens for PatObject

Source§

impl ToTokens for PatPath

Source§

impl ToTokens for PatRest

Source§

impl ToTokens for PatTuple

Source§

impl ToTokens for PatVec

Source§

impl ToTokens for Path

Source§

impl ToTokens for PathSegmentExpr

Source§

impl ToTokens for Perc

Source§

impl ToTokens for PercEq

Source§

impl ToTokens for Pipe

Source§

impl ToTokens for PipeEq

Source§

impl ToTokens for PipePipe

Source§

impl ToTokens for Plus

Source§

impl ToTokens for PlusEq

Source§

impl ToTokens for Pound

Source§

impl ToTokens for Priv

Source§

impl ToTokens for Proc

Source§

impl ToTokens for Pub

Source§

impl ToTokens for Pure

Source§

impl ToTokens for QuestionMark

Source§

impl ToTokens for Ref

Source§

impl ToTokens for Return

Source§

impl ToTokens for Rocket

Source§

impl ToTokens for Select

Source§

impl ToTokens for SelfType

Source§

impl ToTokens for SelfValue

Source§

impl ToTokens for SemiColon

Source§

impl ToTokens for Shebang

Source§

impl ToTokens for SizeOf

Source§

impl ToTokens for SlashEq

Source§

impl ToTokens for Star

Source§

impl ToTokens for StarEq

Source§

impl ToTokens for Static

Source§

impl ToTokens for StmtSemi

Source§

impl ToTokens for Struct

Source§

impl ToTokens for Super

Source§

impl ToTokens for Tilde

Source§

impl ToTokens for Token

Source§

impl ToTokens for True

Source§

impl ToTokens for TypeOf

Source§

impl ToTokens for Underscore

Source§

impl ToTokens for Unsafe

Source§

impl ToTokens for Use

Source§

impl ToTokens for Virtual

Source§

impl ToTokens for While

Source§

impl ToTokens for Yield

Source§

impl ToTokens for TokenStream

Source§

impl<'a> ToTokens for Quote<'a>

Source§

impl<T> ToTokens for Box<T>
where T: ToTokens,

Source§

impl<T> ToTokens for Vec<T>
where T: ToTokens,

Source§

impl<T: ToTokens> ToTokens for EqValue<T>

Source§

impl<T: ToTokens, S: ToTokens> ToTokens for AngleBracketed<T, S>

Source§

impl<T: ToTokens, S: ToTokens> ToTokens for Braced<T, S>

Source§

impl<T: ToTokens, S: ToTokens> ToTokens for Bracketed<T, S>

Source§

impl<T: ToTokens, S: ToTokens> ToTokens for Parenthesized<T, S>