Open dtolnay opened 5 years ago
As far as my understanding of macros goes, this is difficult to achieve at compile time because there isn't a way to read this value from impl sites, where type names can be known. Would it be an acceptable implementation, then, to paste RenameRule::apply_to_variant
to the trait-defining site, and convert the strings during the creation of typetag::Registry
? This would, of course, introduce multiple copies of the renaming code if multiple traits are decorated with typetag
, but imo the code is short enough for this to not pose a huge problem.
I'd be happy to make a PR if this is the case!
any update on this feature?
These should serialize with
"type": "page_load"
and"type": "click"
.