Enum syntax::ext::base::SyntaxExtension [−][src]
pub enum SyntaxExtension { MultiDecorator(Box<MultiItemDecorator + Sync + Send>), MultiModifier(Box<MultiItemModifier + Sync + Send>), ProcMacro { expander: Box<ProcMacro + Sync + Send>, allow_internal_unstable: bool, edition: Edition, }, AttrProcMacro(Box<AttrProcMacro + Sync + Send>, Edition), NormalTT { expander: Box<TTMacroExpander + Sync + Send>, def_info: Option<(NodeId, Span)>, allow_internal_unstable: bool, allow_internal_unsafe: bool, local_inner_macros: bool, unstable_feature: Option<(Symbol, u32)>, edition: Edition, }, IdentTT(Box<IdentMacroExpander + Sync + Send>, Option<Span>, bool), ProcMacroDerive(Box<MultiItemModifier + Sync + Send>, Vec<Symbol>, Edition), BuiltinDerive(BuiltinDeriveFn), DeclMacro { expander: Box<TTMacroExpander + Sync + Send>, def_info: Option<(NodeId, Span)>, is_transparent: bool, edition: Edition, }, }
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
An enum representing the different kinds of syntax extensions.
Variants
MultiDecorator(Box<MultiItemDecorator + Sync + Send>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
MultiModifier(Box<MultiItemModifier + Sync + Send>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A syntax extension that is attached to an item and modifies it in-place. Also allows decoration, i.e., creating new items.
ProcMacro
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A function-like procedural macro. TokenStream -> TokenStream.
Fields of ProcMacro
expander: Box<ProcMacro + Sync + Send> | 🔬 This is a nightly-only experimental API. ( |
allow_internal_unstable: bool | 🔬 This is a nightly-only experimental API. ( |
edition: Edition | 🔬 This is a nightly-only experimental API. ( |
AttrProcMacro(Box<AttrProcMacro + Sync + Send>, Edition)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
NormalTT
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A normal, function-like syntax extension.
bytes!
is a NormalTT
.
Fields of NormalTT
expander: Box<TTMacroExpander + Sync + Send> | 🔬 This is a nightly-only experimental API. ( |
def_info: Option<(NodeId, Span)> | 🔬 This is a nightly-only experimental API. ( |
allow_internal_unstable: bool | 🔬 This is a nightly-only experimental API. ( |
allow_internal_unsafe: bool | 🔬 This is a nightly-only experimental API. ( |
local_inner_macros: bool | 🔬 This is a nightly-only experimental API. ( |
unstable_feature: Option<(Symbol, u32)> | 🔬 This is a nightly-only experimental API. ( |
edition: Edition | 🔬 This is a nightly-only experimental API. ( |
IdentTT(Box<IdentMacroExpander + Sync + Send>, Option<Span>, bool)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A function-like syntax extension that has an extra ident before the block.
ProcMacroDerive(Box<MultiItemModifier + Sync + Send>, Vec<Symbol>, Edition)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
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.
BuiltinDerive(BuiltinDeriveFn)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
An attribute-like procedural macro that derives a builtin trait.
DeclMacro
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
A declarative macro, e.g. macro m() {}
.
Fields of DeclMacro
expander: Box<TTMacroExpander + Sync + Send> | 🔬 This is a nightly-only experimental API. ( |
def_info: Option<(NodeId, Span)> | 🔬 This is a nightly-only experimental API. ( |
is_transparent: bool | 🔬 This is a nightly-only experimental API. ( |
edition: Edition | 🔬 This is a nightly-only experimental API. ( |
Methods
impl SyntaxExtension
[src]
impl SyntaxExtension
pub fn kind(&self) -> MacroKind
[src]
pub fn kind(&self) -> MacroKind
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Return which kind of macro calls this syntax extension.
pub fn default_transparency(&self) -> Transparency
[src]
pub fn default_transparency(&self) -> Transparency
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
pub fn edition(&self) -> Edition
[src]
pub fn edition(&self) -> Edition
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
impl !Send for SyntaxExtension
impl !Send for SyntaxExtension
impl !Sync for SyntaxExtension
impl !Sync for SyntaxExtension