json
JSON text to and from script values. Its null keeps nil through a round trip.
Na této stránce
JSON text to and from script values. Its null keeps nil through a round trip.
3 functions, 0 constants. Scripts reach it as json::.
Functions
Argument kinds are the script values a call passes: node is a node handle, any a table or value of any kind, fn a callback.
| function | acts on | what it does |
|---|---|---|
encode(any) -> string |
— | A value written back out as JSON text; NaN, infinity, a node or a callback has no JSON form and is an error. |
parse(string) -> any |
— | The value a JSON document describes; nil for text that does not parse, as for null. |
parse_async(string) -> int |
— | parse off the frame: the text is parsed on a worker, and task::wait on the token answers its value on the first tick after it is done; a replay wakes it on the tick the recording did, a rollback session on the next tick: let pack = await task::wait(json::parse_async(text));. |