This is one kind of macro in Rust: declarative macros [1]. The other kind of macros in Rust are procedural macros [2]. Both are widely used in idiomatic Rust. And even within the procedural type of macros, there are different categories of macros (i.e., function-, or attribute-like macros).
[1] https://doc.rust-lang.org/book/ch19-06-macros.html
[2] https://doc.rust-lang.org/book/ch19-06-macros.html#procedura...