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

pub enum SyntaxExtension {
    Bang {
        expander: Box<dyn ProcMacro + Sync + Send>,
        allow_internal_unstable: Option<Lrc<[Symbol]>>,
        edition: Edition,
    },
    LegacyBang {
        expander: Box<dyn TTMacroExpander + Sync + Send>,
        def_info: Option<(NodeId, Span)>,
        transparency: Transparency,
        allow_internal_unstable: Option<Lrc<[Symbol]>>,
        allow_internal_unsafe: bool,
        local_inner_macros: bool,
        unstable_feature: Option<(Symbol, u32)>,
        edition: Edition,
    },
    Attr(Box<dyn AttrProcMacro + Sync + Send>, Edition),
    LegacyAttr(Box<dyn MultiItemModifier + Sync + Send>),
    NonMacroAttr {
        mark_used: bool,
    },
    Derive(Box<dyn MultiItemModifier + Sync + Send>, Vec<Symbol>, Edition),
    LegacyDerive(Box<dyn MultiItemModifier + Sync + Send>),
}

An enum representing the different kinds of syntax extensions.

Variants

Bang

A token-based function-like macro.

Fields of Bang

expander: Box<dyn ProcMacro + Sync + Send>

An expander with signature TokenStream -> TokenStream.

allow_internal_unstable: Option<Lrc<[Symbol]>>

Whitelist of unstable features that are treated as stable inside this macro.

edition: Edition

Edition of the crate in which this macro is defined.

LegacyBang

An AST-based function-like macro.

Fields of LegacyBang

expander: Box<dyn TTMacroExpander + Sync + Send>

An expander with signature TokenStream -> AST.

def_info: Option<(NodeId, Span)>

Some info about the macro's definition point.

transparency: Transparency

Hygienic properties of identifiers produced by this macro.

allow_internal_unstable: Option<Lrc<[Symbol]>>

Whitelist of unstable features that are treated as stable inside this macro.

allow_internal_unsafe: bool

Suppresses the unsafe_code lint for code produced by this macro.

local_inner_macros: bool

Enables the macro helper hack (ident!(...) -> $crate::ident!(...)) for this macro.

unstable_feature: Option<(Symbol, u32)>

The macro's feature name and tracking issue number if it is unstable.

edition: Edition

Edition of the crate in which this macro is defined.

Attr(Box<dyn AttrProcMacro + Sync + Send>, Edition)

A token-based attribute macro.

LegacyAttr(Box<dyn MultiItemModifier + Sync + Send>)

An AST-based attribute macro.

NonMacroAttr

A trivial attribute "macro" that does nothing, only keeps the attribute and marks it as known.

Fields of NonMacroAttr

mark_used: bool

Suppresses the unused_attributes lint for this attribute.

Derive(Box<dyn MultiItemModifier + Sync + Send>, Vec<Symbol>, Edition)

A token-based derive macro.

LegacyDerive(Box<dyn MultiItemModifier + Sync + Send>)

An AST-based derive macro.

Methods

impl SyntaxExtension[src]

pub fn kind(&self) -> MacroKind[src]

Returns which kind of macro calls this syntax extension.

pub fn default_transparency(&self) -> Transparency[src]

pub fn edition(&self, default_edition: Edition) -> Edition[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]