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

Add default serialization / deserialization for std.variant #38

Open
andrewbenton opened this issue May 14, 2017 · 3 comments
Open

Add default serialization / deserialization for std.variant #38

andrewbenton opened this issue May 14, 2017 · 3 comments

Comments

@andrewbenton
Copy link
Contributor

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

@rcorre
Copy link
Owner

rcorre commented May 18, 2017

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

@andrewbenton
Copy link
Contributor Author

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.

@LunaTheFoxgirl
Copy link

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

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