Is there a way to get the field names of a struct in a macro?
A macro is expanded during parsing, more or less; it has no access to the AST or anything like that—all it has access to is the stuff that you pass to it, which for my_macro!(S) is purely that there should be a type named S. If you define the struct as part of the macro … Read more