-
-
Notifications
You must be signed in to change notification settings - Fork 868
Open
Labels
Description
The issue originated from #1111 (comment) and #979 (comment).
The idea is that something like this should work:
#[derive(Deserialize)]
#[serde(with="some_module")]
enum SomeEnum {
}
Implementation might work as follows: the code which is usually implemented for Deserialize is generated for a different but similar trait, let's call it DeserializeImpl. Then Deserialize is implemented using some_module::deserialize.
It might even be possible to always generate DeserializeImpl and have a blanket impl<T:DeserializeImpl> Deserialize for T. Thus allowing override Deserialize for a specific struct. But I'm not sure it's entirely backwards compatible.