ron icon indicating copy to clipboard operation
ron copied to clipboard

PrettyPrint struct names

Open JakkuSakura opened this issue 3 years ago • 1 comments

Is it possible to

  1. read a config
  2. prettyprint the ron::Value, while maintaining all struct names
  3. optionally convert the struct names to a tag when converting to serde_json::Value

JakkuSakura avatar Oct 04 '22 05:10 JakkuSakura

The ron Value currently does not yet support storing struct names, but we are exploring the option. Since ron does not distinguish between structs and enums in its data format, in the future it should be possible to serialise the Value into json and preserve the struct names as if they were enum names. However, those would probably be serialised more like single element maps. Though at that point you could write your own Value newtype that customises how structs are serialised.

juntyr avatar Oct 04 '22 05:10 juntyr