Expand description
Proc-macro code generation.
This module generates the actual proc-macro code from resolved definitions.
§Generated Code Structure
The generated code creates attribute macros that:
- Parse the input item (struct/enum)
- Apply configured derives and attributes
- Handle runtime modifiers (
add,omit,omit_attrs)
§Example Output
For a definition like:
[defs.serialization]
traits = ["Clone", "Serialize", "Deserialize"]
attrs = ['#[serde(rename_all = "camelCase")]']The generated code will be:
ⓘ
#[proc_macro_attribute]
pub fn serialization(
args: TokenStream,
input: TokenStream,
) -> TokenStream {
// Parse modifiers from args
// Apply derives and attrs to input
}Functions§
- generate
- Generate proc-macro code to the default
OUT_DIR. - generate_
to - Generate proc-macro code to a specific output path.