Expand description
Map[K, V], Set[T], and Counter[T] (§6.1, §11.3).
All three reuse Rust’s hash collections behind opaque GC objects:
Map[K, V]→HashMap<DynamicKey, GcRef>(§11.3)Set[T]→HashSet<DynamicKey>(§11.3)Counter[T]→HashMap<DynamicKey, GcRef>with Int values (§6.2)
DynamicKey (dynamic_key.rs) bridges Praxis values into Rust’s Hash/Eq
by delegating to the descriptor’s hash/equals callbacks — the mechanism
that lets tuples and records be keys. A non-hashable key type (closure) is
rejected at the capability layer (supports_hash) before reaching here.
Counter’s defining behavior (§6.2): absent keys read as zero, never fault.
min=/max= map updates (§6.2) live in the ABI wrappers.
Structs§
- Counter
Payload - The
Counter[T]payload (§6.2, §11.3). A map whose values are alwaysIntand whose absent keys read as zero. Backed byHashMap<DynamicKey, GcRef>where each value is a boxedInt; the key descriptor selects hash/eq. - MapPayload
- The
Map[K, V]payload (§11.3). Both descriptors are labels: what the construction site knew about the type, or null when it knew nothing. Neither is the authority for an element-wise operation — every key carries its own descriptor on itsDynamicKeyand every value carries one in its object header, and that is whatformat/equals/hashdispatch through. ADR-066 decision 5 is the rule: a null descriptor slot is legal and means “the value’s own descriptor answers”. A non-nullable label would forcepraxis_map_newto spell an unknown type asINT, and anything that trusted it would read aMap[Text, Text]’s values asi64. - SetPayload
- The
Set[T]payload (§11.3). The element descriptor is a label — what the construction site knew, or null when it knew nothing. Each member’sDynamicKeycarries its own descriptor, which is whathashandformatdispatch through.