quartiq / miniconf

Rust serialize/deserialize/access reflection for trees (no_std, no alloc)
MIT License
23 stars 2 forks source link

be generic over the serde implementation #103

Closed jordens closed 11 months ago

jordens commented 1 year ago
ryan-summers commented 1 year ago

I believe it should be relatively easy to make a Miniconf impl generic over a Serializer or Deserializer that we call into directly. We could easily also provide defaults for serde_json_core as well if desired.

The indices should definitely be FromStr parseable.

jordens commented 1 year ago

or even just set_path() generic over Deserializer and get_path generic over Serializer.

ryan-summers commented 1 year ago

Hmm... One annoyance is that serde_json_core does not expose the Serializer and Deserializer via the public API. That being said, I don't see why we couldn't make a PR to add that support. The user would be responsible for constructing the serializer/deserializer from a buffer, but that's no big ask.

jordens commented 1 year ago

Ack. We can still expose that easier serde-json-core API that does that for the user in the same way we expose set() that splits the path for the user before calling set_path().