Skip to main content

Module value

Module value 

Source
Expand description

RuntimeValue — the dynamically-typed value enum the IR interpreter and witness backends carry on the operand stack.

Replaces the previous serde_json::Value-as-stack-value design (which forced every byte buffer through hex-string round-trips and coupled the IR interpreter to the serde_json crate). The new enum is byte-honest: Bytes(Vec<u8>) keeps bytes as bytes, Int(i128) covers every Compact Uint<…> rung, and Object is a BTreeMap so iteration order is deterministic across runs.

From<serde_json::Value> / Into<serde_json::Value> conversions exist as a migration aid — call sites that haven’t crossed over yet stage at the boundary. Long-term every IR interpreter / witness call should be RuntimeValue end-to-end and the conversions become display-only (runtime::ledger’s human-surface projector).

Structs§

ValueProjectionError
Failure projecting a RuntimeValue back into a typed Rust scalar. Carried by every TryFrom<RuntimeValue> impl so generated code can wrap with field/argument context.

Enums§

RuntimeValue
Dynamically-typed value carried by the IR interpreter and witness backends. See module docs for design notes.

Traits§

ValueIndex
Index trait for RuntimeValue::get. Mirrors serde_json::value::Index — &str indexes objects, usize indexes arrays.