Expand description
Heap-allocated value types reachable through HeapValue.
After the strict-typing Phase-2 bulldozer (option C — heterogeneous
collections / dynamic single-value wrappers excised), HeapValue carries
only typed payloads:
- typed primitives (string, decimal, bigint, char, future-id),
- typed handles (datatable, content, instant, io-handle, native scalars),
- typed object slots (
TypedObjectwithBox<[ValueSlot]>), - the typed-closure-raw block (
ClosureRaw), - typed temporal data (
TemporalData), - typed table views (
TableViewData).
V3-S5 ckpt-1..ckpt-4 (2026-05-15): the inline TypedArrayData enum +
the outer HeapValue::TypedArray(Arc<TypedArrayData>) arm +
TypedBuffer<T> / AlignedTypedBuffer wrapper layer were retired
wholesale per W12-typed-array-data-deletion-audit §3.5 + §B + ADR-006
§2.7.24 Q25.A SUPERSEDED. The canonical replacement is the v2-raw
TypedArray<T> flat struct at crate::v2::typed_array::TypedArray<T>
(per docs/runtime-v2-spec.md). The HeapKind::TypedArray = 8
ordinal is vacated; do not reuse.
Variants that previously held ValueWord (the deleted dynamic word) —
Some/Ok/Err/Range/TraitObject/FunctionRef,
HashMap/Set/Deque/PriorityQueue, Iterator/Generator/
ProjectedRef, Concurrency (Mutex/Atomic/Lazy/Channel), Rare,
Enum, Array (heterogeneous-element), HostClosure — were removed
together with their *Data structs. The corresponding HeapKind
ordinals are preserved (annotated “(removed)” in heap_variants.rs)
and await monomorphized typed replacements per docs/runtime-v2-spec.md.
Structs§
- Atomic
Data Atomic<i64>storage — wraps astd::sync::atomic::AtomicI64for the atomic operations exposed by theAtomic.load/store/fetch_add/fetch_sub/compare_exchangemethod surface.- Channel
Data - MPSC-style synchronous channel storage.
- Deque
Data - Double-ended queue storage. Heterogeneous element kinds are stored as
Arc<HeapValue>payloads (mirror ofHashMapData::valuesper ADR-005 §1 single-discriminator) — the deque is element-kind-agnostic at landing, in line with the W13-hashmap precedent. - Hash
MapData - HashMap storage — keys buffer (string-typed v2-raw
*mut TypedArray<*const StringObj>) - Hash
SetData - HashSet storage — one keyspace, no values. Mirror of
HashMapDatawith the values buffer dropped. - IoHandle
Data - Data for IoHandle variant (Arc-wrapped at the HeapValue level to keep
HeapValue small and to enable cluster #2 marshal
FromSlot for Arc<IoHandleData>). - Lazy
Data Lazy<T>storage — wraps an initializer closure (KindedSlotof kindPtr(HeapKind::Closure)) and a cached value slot.get()runs the initializer the first time and caches the result; subsequent calls return the cached value.- Matrix
Data - Flat, SIMD-aligned matrix storage (row-major order).
- Matrix
Slice Data - Row/column projection into a parent
MatrixData({ parent, offset, len }). - Mutex
Data Mutex<T>storage — a single typed payload protected by a RustMutexso concurrentArc<MutexData>shares observe each other’s mutations (the canonical “shared cell with exclusion” shape, mirror ofChannelData’sMutex<ChannelInner>interior-mutability shape).- Native
Layout Field - Field layout metadata for
type Cstructs. - Native
Type Layout - Runtime layout descriptor for one native type.
- Native
View Data - Pointer-backed zero-copy view into native memory.
- Option
Data - Option
carrier. is_somediscriminates Some vs None;payloadcarries the inner value for Some. For None the payload is aKindedSlot::none()placeholder (Bool-kind, zero bits) soKindedSlot::Dropis a no-op. - Priority
Queue Data - PriorityQueue storage — i64-priority min-heap.
- Range
Data - Range value carrier — an inclusive-or-exclusive integer interval with
step. Built by
MakeRangefrom the surface syntaxstart..end(exclusive) andstart..=end(inclusive); produced as a typedArc<RangeData>slot labeledNativeKind::Ptr(HeapKind::Range). - Result
Data - Result<T, E> carrier.
is_okdiscriminates Ok vs Err;payloadcarries the inner value (Tfor Ok,Efor Err). Both arms share the same payload slot — the variant tag is the discriminator, not the slot’s physical layout. - Task
Group Data - Task-group payload. Extracted from the inline
HeapValue::TaskGroup { kind, task_ids }struct variant per ADR-006 §2.3 soHeapValue::TaskGroupbecomes a single-tupleArc<T>payload like every other ADR-006 §2.3 heap arm. - Trait
Object Ptr - Owning newtype around
*const TraitObjectStoragecarrying one v2-raw refcount share on the pointed-to allocation’s HeapHeader. - Trait
Object Storage dyn Traitstorage — the typed-Arc replacement for the bulldozer-deletedHeapValue::TraitObject { value: Box<u64>, vtable: Arc<VTable> }. Pairs the boxed data half (always aTypedObjectper §Q25.C.4 universal-dyn ruling — scalars/strings that implement traits are boxed intoTypedObjectfirst; the auto-boxing rule lifts Rust’s object-safety restrictions at the cost of one heap indirection perdyncoerce) with the vtable half (sharedArc<VTable>so per-impl vtables are constructed once and IC-cached per §Q25.C.6).- Typed
Object Ptr - Owning newtype around
*const TypedObjectStoragecarrying one v2-raw refcount share on the pointed-to allocation’s HeapHeader. - Typed
Object Storage - Schema-keyed object storage. Extracted from the inline
HeapValue::TypedObject { schema_id, slots, heap_mask }struct variant per ADR-006 §2.3, so that:
Enums§
- Hash
MapKinded Ref - HashMapKindedRef — kinded carrier for
Arc<HashMapData<V>>per audit §C.4 option (a.2). Bundles per-V monomorphized payload types as enum variants; the variant tag IS theNativeKinddiscriminator at the carrier layer. - Heap
Kind - Discriminator for HeapValue variants, usable without full pattern match.
- Heap
Value - Compact heap-allocated value. Strict-typed variants only — every
payload is either a typed primitive (
i64,char,f64viaTypedArray), a typed structure (TypedObjectslots, typed FFI pointers, typed temporal data), or a typed handle. - IoHandle
Kind - I/O handle kind discriminant.
- IoResource
- The underlying OS resource wrapped by an IoHandle.
- Native
Scalar - Native ABI-width scalars used by C ABI /
extern C fnboundaries. - Table
View Data - Table view data — consolidates TypedTable, RowView, ColumnRef, and IndexedTable.
- Temporal
Data - Temporal data — consolidates Time, Duration, TimeSpan, Timeframe, TimeReference, DateTimeExpr, and DataDateTimeRef.
Traits§
- Hash
MapValue Elem - Per-V dispatcher trait for
HashMapData<V>::Drop— releases the value buffer (*mut TypedArray<V>) at refcount-0 of the enclosingArc<HashMapData<V>>.