Procedural Macros and Derive

Updated

October 31, 2026

Procedural Macros and Derive

Procedural macros operate on Rust token streams directly as AST transformations: 1. Custom Derive: #[derive(MyTrait)] 2. Attribute-like: #[route(GET, "/")] 3. Function-like: sql!("SELECT * FROM users")