Skip to main content

Module value

Module value 

Source
Expand description

The script value type and its coercion rules.

Every shell variable, command result, and pipeline element is a serde_json::Value. Nothing in this interpreter is stringly typed, so capability inputs and outputs never need marshaling: the rest of the workspace already speaks serde_json::Value everywhere.

Functions§

display
Coerces one value to its display form.
from_lines
Converts a line list back into a value.
index
Indexes a value with one display-coerced key.
object_from_pairs
Builds an object from ordered key/value pairs, folding repeated keys into arrays.
scalar_from_token
Parses one argv token into a value, keeping ambiguous text as a string.
to_lines
Converts a value into the line list consumed by text-shaped builtins.
to_text
Converts a value into the text a text-shaped builtin operates on.
truthy
Reports whether a value is “true” for if, while, and test.