There are 4 broad types of macros

  1. Declerative Macros (vec!, println!) - The most widely used form of macros in Rust is the declarative macro. At their core, declarative macros allow you to write something similar to a Rust match expression.
  2. Procedural Macros -  Procedural macros accept some code as an input, operate on that code, and produce some code as an output rather than matching against patterns and replacing the code with other code as declarative macros do.
    1. custom derive macros
    2. attribute-like macros
    3. function-like macros

Screenshot 2025-07-15 at 1.03.15 PM.png