JsonArray¶
Immutable JSON array backed by a persistent vector.
Construction is via chained .push() calls, each returning a new array
with structural sharing:
Implements¶
- Stringable box
Constructors¶
create¶
Parameters¶
Returns¶
- JsonArray val^
Public Functions¶
apply¶
Look up a value by index. Raises if out of bounds.
Parameters¶
- i: USize val
Returns¶
size¶
Number of elements.
Returns¶
- USize val
update¶
Return a new array with element at index i replaced. Raises if out of bounds.
Parameters¶
Returns¶
- JsonArray val ?
push¶
Return a new array with value appended.
Parameters¶
- value: JsonValue
Returns¶
- JsonArray val
pop¶
Return (new array without last element, removed element). Raises if empty.
Returns¶
values¶
Iterate over values.
Returns¶
pairs¶
Iterate over (index, value) pairs.
Returns¶
string¶
Compact JSON serialization.
Returns¶
- String iso^
pretty_string¶
Pretty-printed JSON serialization.
Parameters¶
- indent: String val = " "
Returns¶
- String iso^