We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the exact issues on supporting internally tagged enums for all cases (newtypes of all types (ha!), tuple variants, etc)
I would guess in case of the tuple variants in the default case the challenge is where to put the data.
I would propose two solutions:
#[derive(Serialize, Deserialize)] #[serde(tag = variant )] enum Foo { Tuple( #[serde(key = bar)] Bar, #[serde(key = baz)] Baz), Newtype( #[serde(key = value )] u32) }
This would serialize to yaml like so:
data: - variant: Tuple bar: .... baz: ..... - variant: Newtype value: 42
The latter would basically allow newtype/struct variants to be serialized/ deserialuzes as struct variants.
The text was updated successfully, but these errors were encountered:
Perhaps use the already existing rename directive
Sorry, something went wrong.
No branches or pull requests
What is the exact issues on supporting internally tagged enums for all cases (newtypes of all types (ha!), tuple variants, etc)
I would guess in case of the tuple variants in the default case the challenge is where to put the data.
I would propose two solutions:
This would serialize to yaml like so:
The latter would basically allow newtype/struct variants to be serialized/ deserialuzes as struct variants.
The text was updated successfully, but these errors were encountered: