Expand description
This crate contains most of the internal implementation of the macros in the
macro_magic_macros crate. For the most part, the proc macros in macro_magic_macros just
call their respective _internal variants in this crate.
Structs§
- Attr
Item With Extra - Used to parse args passed to the inner pro macro auto-generated by
import_tokens_attr_internal. - Forward
Tokens Args - Used to parse args that were passed to
forward_tokens_internal. - Forward
Tokens Extra Arg - Used to parse args that were passed to
forward_tokens_internalandforward_tokens_inner_internal. - Forwarded
Tokens - Used to parse args that were passed to
forward_tokens_inner_internal. - Import
Tokens Args - Used to parse the args for the
import_tokens_internalfunction. - Imported
Tokens - Used to parse the args for the
import_tokens_inner_internalfunction. - Proc
Macro - Generically parses a proc macro definition with support for all variants.
Enums§
- Proc
Macro Type - Delineates the different types of proc macro
Constants§
- MACRO_
MAGIC_ ROOT - Constant used to load the configured location for
macro_magicthat will be used in generated macro code.
Traits§
- Foreign
Path - Should be implemented by structs that will be passed to
#[with_custom_parsing(..)]. Such structs should also implementsyn::parse::Parse.
Functions§
- export_
tokens_ alias_ internal - Internal implementation of
export_tokens_alias!. Allows creating a renamed/rebranded macro that does the same thing as#[export_tokens] - export_
tokens_ internal - The internal code behind the
#[export_tokens]attribute macro. - export_
tokens_ macro_ ident - Produces the full path for the auto-generated callback-based decl macro that allows us to forward tokens across crate boundaries.
- export_
tokens_ macro_ path - Resolves to the path of the
#[export_tokens]macro for the given item path. - flatten_
ident - “Flattens” an
Identby converting it to snake case. - forward_
tokens_ inner_ internal - Used by
forward_tokens_internal. - forward_
tokens_ internal - The internal implementation for the
forward_tokensmacro. - import_
tokens_ attr_ internal - Internal implementation for the
#[import_tokens_attr]attribute. - import_
tokens_ inner_ internal - The internal implementation for the
import_tokens_innermacro. - import_
tokens_ internal - The internal implementation for the
import_tokensmacro. - import_
tokens_ proc_ internal - Internal implementation for the
#[import_tokens_proc]attribute. - macro_
magic_ path - Safely access a subpath of
macro_magic - macro_
magic_ root - Safely access the
macro_magicroot based on theMACRO_MAGIC_ROOTenv var, which defaults to::macro_magic, but can be configured via the[env]section of.cargo/config.toml - parse_
proc_ macro_ variant - Parses a proc macro function from a
TokenStream2expecting only the specifiedmacro_type - private_
path - Safely access a subpath of
macro_magic::__private - to_
snake_ case - Returns the specified string in snake_case
- with_
custom_ parsing_ internal - The internal implementation for the
#[with_custom_parsing(..)attribute macro.