Skip to main content

Module inspector_drill

Module inspector_drill 

Source
Expand description

Drilling into a nested value from the row inspector: a struct’s fields, a list’s items, or the objects and arrays of JSON stored as text.

A level holds where it is, never a copy of what is there: a column’s value is a one-row slice of the buffer’s series, and a JSON value is a path into a document parsed once. Only the items on screen are ever turned into rows, so a list of a million items costs as much to show as a list of ten.

Structs§

Drill
The levels opened under one field of one row, outermost first.
JsonWait
Text being parsed as JSON off the event thread, and where its level opens.
Level
One level of a drill: the value it lists, and the item focused in it.

Enums§

Node
One place in a value: what a level of the drill shows, or one of its items.
Shape
What a node holds, as the drill sees it.
Step
One step into a JSON document. An object’s step is its key, not its position: serde_json’s map has no lookup by position, and walking to the 500,000th key of a large object for every item drawn, on every frame, is what a key avoids.

Constants§

JSON_INLINE_BYTES
Text up to this long is parsed as JSON on the key that asks; longer text is parsed off the event thread.
JSON_MAX_BYTES
Text longer than this is not parsed: its tree would take several times its size.

Functions§

json_copy_text
A JSON value as copy text: text as itself, a null as empty, anything else as JSON, indented when it is an object or array. None when it is over cap bytes.
json_kind
A JSON value’s kind, as the item list names it.
json_text
value as JSON text, indented or on one line, stopping at cap bytes. True when it was cut there.
looks_like_json
Whether text reads as a JSON object or array: it starts and ends with the brackets of one. Whether it parses is learned only by parsing it.
opens_as_json
Whether Enter offers to open text as JSON: it reads as an object or array and is not over JSON_MAX_BYTES, past which Enter shows more of it instead.
parse_json
Parse text as JSON, refusing text over JSON_MAX_BYTES. serde_json stops at 128 levels of nesting, so a deep document is an error, not a stack overflow.
path_key
A place in a row, for telling one item from another: the field, then each step opened and the item. Unit separators cannot be typed into a name, so two places never meet.