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

Constructing objects from Value #128

Open
AmateurECE opened this issue Mar 11, 2024 · 0 comments
Open

Constructing objects from Value #128

AmateurECE opened this issue Mar 11, 2024 · 0 comments

Comments

@AmateurECE
Copy link

AmateurECE commented Mar 11, 2024

I have a use case where I need to "deserialize" Values into instances of struct Foo.

This feels related to #17. Perhaps the impedance mismatch between valuable::Visit and serde::de::Visit is slight enough to be overcome with a generic implementation that allows deserializing a valuable::Value into anything that implements serde::de::Deserialize?

A while ago, I decided to start on an implementation that relies on a FromValue trait and a corresponding proc-macro, which can fallibly convert valuable::Value to any type that it's implemented for. I guess at the time, I must not have considered the serde solution. That implementation is available here.

Is this kind of functionality something that the team would be interested in incorporating into valuable or valuable-serde? If so, what should be the shape of that solution? Alternatively, if something seems fundamentally wrong about my use of tokio tracing, I would appreciate your feedback. Thanks very much!

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

1 participant