dtolnay/typetag

Ability to enumerate/inspect list of supported tags

nmathewson opened this issue · 1 comments

Thanks for the useful crate!

Would you accept an MR for a feature to enumerate or inspect the list of supported tags? And if so, what would you want the API to look like?

Here are our use-cases:

  • On a parse failure, we want our error message to be able to tell the user whether the tag was unrecognized, or whether there was a problem with the data associated with the tag.
  • We want to make sure that every tag in our program obeys a given naming scheme.

I would prefer not to support this in this crate, but it would be reasonable for someone else to maintain a more fully featured implementation that exposes tags as a list. Alternatively you could wrap typetag::deserialize in your own macro that also keeps track of its own list of tags.