Thanks for the great advice! Start small.
These are great questions and help me form a heuristic.
I've heard of the little book of Rust macros but not read it. It looks quite informative. I'm curious about that "simple pushdown accumulator" topic.
As I learn procedural macros I realize my initial use-case is backwards. My primary goal is generating Rust data structures from an XML Schema Definition file for WordprocessingML (Microsoft Word). I'm only require a subset of the schema but need each struct to implement
Write using the correctly namespaced tag. e.g.
w:t for a struct named
So I am shifting my approach. Rather than use the proc macro to validate existing Rust structs, why not generate them directly from a parsed XSD with the correctly specified tag names? Practically I'm using strong-xml to avoid the work of implementing custom writers.
That is a clever idea! I will keep that in mind as an option.
And as an aside on working with WordprocessingML and Rust, I've been finding serde and XML are not a great fit. I noted more details in a closed serde-xml-rs issue.