jsonizer icon indicating copy to clipboard operation
jsonizer copied to clipboard

Add default serialization / deserialization for std.variant

Open andrewbenton opened this issue 7 years ago • 3 comments

Given that Variant is a close mirror to JSONValue, we should be able to serialize and deserialize against a Variant.

andrewbenton avatar May 14 '17 12:05 andrewbenton

I'm hesitant to special-case any non-builtin type. What's your use case?

rcorre avatar May 18 '17 00:05 rcorre

I understand the hesitation. I wouldn't suggest it if it wasn't part of the standard library. For what I'm interested in, it serves as a library-agnostic serde of an unspecified type. If I want some sort of cross-compatibility between different serde formats, being able to target Variant is useful. If I was only targeting jsonizer, I would be able to leave the type as JSONValue, but that doesn't work if I also want to serde against MsgPack, as an example.

andrewbenton avatar May 19 '17 12:05 andrewbenton

The alternative is support for void*, which would be very bad.

LunaTheFoxgirl avatar Jul 07 '18 01:07 LunaTheFoxgirl