Rust macros are a powerful tool to map a certain input sequence to an output sequence according to a defined procedure.
There are currently two types of macros in Rust:
The "regular" macros defined with
macro_rules!
. You can find some examples in the Rust by example bookThe procedural macros, also called compiler extensions. You should use rust-compiler-plugin for the questions related to this kind of macros.