Fragment specifiers in Rust Macros
Rust macros seemed like an enigma when I first saw it, but once I started understanding it a bit, it’s not all that bad!
“Fragment specifiers” are what you see as the “type” of an argument that you might see in the invocation of the macro. The most common being expr. Like below,
macro_rules! add_two_numbers { ($num1:expr, $num2:expr) => { $num1 + $num2 }; } fn main() { let _result = add_two_numbers!
anoopelias.github.io