Skip to main content

Module value

Module value 

Source
Expand description

Structured value used for defaults, examples, extensions, link parameters, and constraint values.

Plugins do not link a JSON parser to read these — the host populates them from the parsed spec.

§Pool design (issue #85 follow-up, ADR-0007 amendment realised)

WIT does not support recursive variants. list<value> and object(list<tuple<string, value>>) cannot be represented at the boundary directly, so the compound arms hold ValueRef indices into crate::Ir::values rather than recursing by value. Every Value-shaped IR field stores a ValueRef; the pool is the only place that owns a Value.

  • Value::List { items }items: Vec<ValueRef>
  • Value::Object { fields }fields: Vec<(String, ValueRef)>

The pool is structurally deduplicated by the parser: pushing a Value that is already present at index i returns i. SDK helpers (resolve, to_json) walk the pool to materialise tree-shaped representations on demand.

See ADR-0006 for the parallel type-pool design.

Enums§

Value

Type Aliases§

ValueRef
Index into crate::Ir::values.