pub struct DequeData {
pub items: VecDeque<Arc<HeapValue>>,
}Expand description
Double-ended queue storage. Heterogeneous element kinds are stored as
Arc<HeapValue> payloads (mirror of HashMapData::values per ADR-005
§1 single-discriminator) — the deque is element-kind-agnostic at
landing, in line with the W13-hashmap precedent.
ADR-006 §2.7.19 / Q20 amendment (Wave 15 W15-deque, 2026-05-10).
Mirror of the §2.7.15 HashSet shape (full HeapValue::Deque arm,
NOT pure-discriminator like FilterExpr / SharedCell): receivers
flow through slot.as_heap_value() for receiver classification at
method dispatch (d.pushBack(...) / d.popFront() / d.size()).
Heterogeneous-element keyspace at landing. Element kinds that
can be heap-wrapped (string / int via BigInt(Arc<i64>) / typed
arrays / typed objects / hashmaps / etc.) are accepted by the
mutation API; bare Float64 / Bool results are rejected (no
matching HeapValue::* arm exists post-§2.3). Same coverage shape
as HashMapData::values storage (hashmap_methods.rs:: result_slot_to_heap_value_arc).
Per the W15-deque audit: VecDeque<Arc<HeapValue>> chosen over the
alternative Vec<u64> + parallel Vec<NativeKind> (per §2.7.7
stack ABI) — Deque is heterogeneous-element, not scalar-only, so
the parallel-kind track shape would force every push site to
carry both bits and kind through the deque API. The
Arc<HeapValue> shape collapses both into a single payload at the
element tier and matches the Stage C P1(b) HashMap precedent.
Fields§
§items: VecDeque<Arc<HeapValue>>Insertion-ordered double-ended queue of heap-allocated element
payloads. Element kinds are recovered via the canonical ADR-005
§1 single-discriminator HeapValue match at the read site.
Implementations§
Source§impl DequeData
impl DequeData
Sourcepub fn from_items(items: Vec<Arc<HeapValue>>) -> Self
pub fn from_items(items: Vec<Arc<HeapValue>>) -> Self
Build from a Vec<Arc<HeapValue>>. Insertion order is the
front-to-back walk order.
Sourcepub fn peek_front(&self) -> Option<&Arc<HeapValue>>
pub fn peek_front(&self) -> Option<&Arc<HeapValue>>
Borrow the front element without removing it. None when empty.
Sourcepub fn peek_back(&self) -> Option<&Arc<HeapValue>>
pub fn peek_back(&self) -> Option<&Arc<HeapValue>>
Borrow the back element without removing it. None when empty.
Sourcepub fn get(&self, index: usize) -> Option<&Arc<HeapValue>>
pub fn get(&self, index: usize) -> Option<&Arc<HeapValue>>
Borrow the element at index (front-counted). None when out
of bounds.
Sourcepub fn push_front(&mut self, value: Arc<HeapValue>)
pub fn push_front(&mut self, value: Arc<HeapValue>)
Push an element onto the front of the deque.