Enum syntax::ext::base::SyntaxExtension [] [src]

pub enum SyntaxExtension {
    MultiDecorator(Box<MultiItemDecorator>),
    MultiModifier(Box<MultiItemModifier>),
    ProcMacro(Box<ProcMacro>),
    AttrProcMacro(Box<AttrProcMacro>),
    NormalTT(Box<TTMacroExpander>, Option<Span>, bool),
    IdentTT(Box<IdentMacroExpander>, Option<Span>, bool),
    ProcMacroDerive(Box<MultiItemModifier>, Vec<Symbol>),
    BuiltinDerive(BuiltinDeriveFn),
}
🔬 This is a nightly-only experimental API. (rustc_private)

An enum representing the different kinds of syntax extensions.

Variants

🔬 This is a nightly-only experimental API. (rustc_private)

A syntax extension that is attached to an item and creates new items based upon it.

#[derive(...)] is a MultiItemDecorator.

Prefer ProcMacro or MultiModifier since they are more flexible.

🔬 This is a nightly-only experimental API. (rustc_private)

A syntax extension that is attached to an item and modifies it in-place. Also allows decoration, i.e., creating new items.

🔬 This is a nightly-only experimental API. (rustc_private)

A function-like procedural macro. TokenStream -> TokenStream.

🔬 This is a nightly-only experimental API. (rustc_private)

An attribute-like procedural macro. TokenStream, TokenStream -> TokenStream. The first TokenSteam is the attribute, the second is the annotated item. Allows modification of the input items and adding new items, similar to MultiModifier, but uses TokenStreams, rather than AST nodes.

🔬 This is a nightly-only experimental API. (rustc_private)

A normal, function-like syntax extension.

bytes! is a NormalTT.

The bool dictates whether the contents of the macro can directly use #[unstable] things (true == yes).

🔬 This is a nightly-only experimental API. (rustc_private)

A function-like syntax extension that has an extra ident before the block.

🔬 This is a nightly-only experimental API. (rustc_private)

An attribute-like procedural macro. TokenStream -> TokenStream. The input is the annotated item. Allows generating code to implement a Trait for a given struct or enum item.

🔬 This is a nightly-only experimental API. (rustc_private)

An attribute-like procedural macro that derives a builtin trait.

Methods

impl SyntaxExtension
[src]

🔬 This is a nightly-only experimental API. (rustc_private)

Return which kind of macro calls this syntax extension.