bevyengine/bevy
bevy_macro_utils
Shared utilities used by Bevy's proc macros. Not depended on by user code; meant to be consumed only by sibling derive crates (bevy_ecs_macros, bevy_reflect_derive, bevy_derive, etc.).
Purpose
Avoid re-implementing the same things across every derive crate:
- Locate the active
bevy_*crate (sobevy_ecs::Componentworks whether or not the user re-exports throughbevy). - Walk
syntypes to find lifetimes, generics, and attribute arguments. - Manipulate
darling-style attribute parsing in a uniform way. - Token-stream helpers and label / system-set boilerplate.
Directory layout
crates/bevy_macro_utils/src/
├── lib.rs # Public re-exports
├── attrs.rs # Attribute parsing helpers
├── bevy_manifest.rs # Find the right bevy crate path
├── label.rs # Macro helpers for ScheduleLabel/SystemSet derives
├── shape.rs # syn helpers for struct/enum shape introspection
├── symbol.rs # Static identifier interning
└── …Key abstractions
| Symbol | File | Description |
|---|---|---|
BevyManifest |
crates/bevy_macro_utils/src/bevy_manifest.rs |
Finds the path to a bevy crate from the user's Cargo.toml. |
derive_label |
crates/bevy_macro_utils/src/label.rs |
Generates a ScheduleLabel/SystemSet/SystemLabel impl. |
Symbol |
crates/bevy_macro_utils/src/symbol.rs |
Cached Idents. |
Integration points
- Depends on:
proc-macro2,quote,syn,cargo_manifest. - Depended on by:
bevy_ecs_macros,bevy_reflect_derive,bevy_derive,bevy_appmacros.
Entry points for modification
- Mostly stable. Touch only when refactoring a derive macro across multiple crates.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.