New netdoc parser, with derive macro
I plan to use this in the dirauth code to parse votes (and other documents).
In this MR:
- We provide new, better structured test data, and use it in a couple of existing tests and new ones.
- We expose more widely a couple of the existing bits of tor-netdoc that I could reuse.
- We provide a whole new parser, in a new
parse2
module. - The new traits are implemented only on a proof-of-concept re-statement of a (skeleton of) network documents - but, these are enough to parse the docuemnt and check the signatures.
- The proof of concept also demonstrates how to reuse the same source code for defining consensus, md consensus, and vote.
Plans in the short to medium term, in this area, are in #1929.
Things I plan to leave for a much later day:
- Replace all ues of the existing parser traits.
- Remove the existing parser.
- Tidy up the types and rename things to have a reasonable unified naming scheme.
Not yet ready for review; getting the CI sorted first
Edited by Ian Jackson