Skip to content

serde(with) for containers #1118

@tailhook

Description

@tailhook

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions