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

Implement valuable-serde crate #17

Closed
carllerche opened this issue May 12, 2021 · 3 comments · Fixed by #23
Closed

Implement valuable-serde crate #17

carllerche opened this issue May 12, 2021 · 3 comments · Fixed by #23
Assignees

Comments

@carllerche
Copy link
Member

It should be possible to implement Serde's Serialize trait for valuable::Value. This should enable using Serde's existing serializer ecosystem with valuable.

@carllerche
Copy link
Member Author

@taiki-e is this something you would be interested in taking on? If it is, you can assign the issue to yourself.

@taiki-e taiki-e self-assigned this May 13, 2021
@taiki-e
Copy link
Member

taiki-e commented May 13, 2021

I've tried it before: https://github.com/tokio-rs/valuable/blob/84c6992b55981181d7b75bb79fcf26428994a019/valuable/examples/serde.rs

If I remember correctly:

  • As for implementing Seriarize on Value: I changed some fields such as StructDef::name from &'a str to &'static str, but there were no other major problems.
  • As for implementing Valuable on impl Seriarize: It was very difficult and I could not get it to work well.

I will try to update it to the current valuable trait and see if it works.

@taiki-e
Copy link
Member

taiki-e commented May 14, 2021

Draft implementation is here: #23

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

Successfully merging a pull request may close this issue.

2 participants