[Feature]: Implement convenience accessors for Value
like serde_json
#82
Labels
enhancement
New feature or request
Value
like serde_json
#82
Is there an existing issue for this?
Description
The
Value
type inserde_json
has convenience accessors ofIndex
trait and.get()
.Basically how they work is that
.get()
will try to index the value with the given type, returning anOption<&Value>
as result. UsingIndex
trait however never fails but just returns objects that are "undefined" in JSON terms. What this means in practice is that I can do something like this:This makes it really convenient to access free form deeply nested JSON data which would be inconvenient to map to nested structures.
In order to implement this, however, the
Map
variant ofValue
should probably be changed to something which supports fast random access, as suggested in #81.Acceptance Criteria
No response
Suggestions for a technical implementation
No response
The text was updated successfully, but these errors were encountered: