Skip to content
New issue

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

Incorporate serde_tuple functionality into this crate #800

Open
UnlimitedCookies opened this issue Nov 4, 2024 · 3 comments
Open

Incorporate serde_tuple functionality into this crate #800

UnlimitedCookies opened this issue Nov 4, 2024 · 3 comments

Comments

@UnlimitedCookies
Copy link

The crate serde_tuple seems to be abandoned and I think its functionality would be a good fit for this crate.

Basically it omits the field names when (de)serializing a struct and just outputs a tuple (in JSON also a list) with the values, making them dependent on the order when de-serializing the the struct.

The serde_tuple crate is also missing functionality like (de)serializing an enum with struct fields into a tuple (where the first entry is the enum variant identifier), so it would be awesome if this crate could accomplish that as well.

@ShayBox
Copy link

ShayBox commented Nov 11, 2024

I also came to say this, what are the odds lol

@jonasbb
Copy link
Owner

jonasbb commented Nov 12, 2024

Hey, thanks for the suggestion. I would love to see some better serde derives, but I can't maintain that. The implementation of serde_tuple seems relatively simple, but it requires serde_derive to perform the heavy lifting. This does restrict its design too, so support for enums might be some effort.

@ShayBox
Copy link

ShayBox commented Nov 12, 2024

My use case would be to remap a struct like Vec3 to a tuple struct using something like "(x, y, z)" where the letters are the fields of the struct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants