Skip to content

Constructing objects from Value #128

Open
@AmateurECE

Description

@AmateurECE

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions