Closed doug-q closed 2 months ago
I would prefer not to build this into this crate. But I would be interested in someone else making a more fully featured library for trait object serialization, which could support this case (and maybe a few of the other feature requests from this repo).
We are using typetag in our application to allow users to extend our system with their own types. Deseralisation of a
typetag
ed trait can fail for two reasons:In the first case, we are able to degrade gracefully and proceed, keeping the value of unknown type as opaque JSON. In the second case, we must hard fail.
It seems that with typetag as is we are not able to distinguish between these two cases. Would you be willing to accept a PR adding this feature?
One strawman idea would be to add a public(i.e. not-hidden) method to
dyn <Trait>
: