Is it possible to deserialize enums by an attribute, not by name, similar to what SerDe tag attribute does?
<parent>
<child type="A" attr1="" attr2=""/>
<child type="B" attr3="" attr4=""/>
</parent>
struct Parent {
children: Vec<Child>
}
enum Child {
A { attr1: String, attr2: String },
B { attr3: String, attr4: String }
}
I have a lot of those Child elements, they all share about 3 attributes, but have all other attributes and inner elements are different, so it is hard to create a common structure that cover them all