nx-value
NxValue: the value a Rust host passes to compiled NX and reads back from
it.
It is a JSON-like tree (booleans, integers, floats, strings, lists and records with an optional
type name) and it is the Rust form of an NX canonical value, so a host builds one and passes it as
it is. JSON and MessagePack are encodings of it for a wire or a store, both through serde.
use NxValue;
let value = from_json_str.unwrap;
let Record = &value else ;
assert_eq!;
assert_eq!;
assert_eq!;
NX has no null: its absent value is the empty list, NxValue::empty(). NxValue::Null is the
host's spelling of absence, which NX reads as the empty value and writes in the two places the
canonical encoding spells null. Host values in
docs/nx-ir-format.md defines the
model.
To run compiled NX with these values, depend on
nx-ir-runtime.
The crate is versioned with the NX release it ships in, and its API may change between minor
versions while NX is 0.x. Depend on it at the same version as nx-ir-runtime.