serde_with icon indicating copy to clipboard operation
serde_with copied to clipboard

Incorporate serde_tuple functionality into this crate

Open UnlimitedCookies opened this issue 1 year ago • 3 comments

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.

UnlimitedCookies avatar Nov 04 '24 15:11 UnlimitedCookies

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

ShayBox avatar Nov 11 '24 05:11 ShayBox

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.

jonasbb avatar Nov 12 '24 00:11 jonasbb

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

ShayBox avatar Nov 12 '24 02:11 ShayBox