shape
Nu shape domain: declare structure once, reach it through refs any fabric backs.
Module nu.domains.shape.
Nu shape domain: declare structure once, reach it through refs any fabric backs.
A Shape declares slots; each slot is a ref blueprint that a fabric completes with its own storage. Blueprints come in families (item, mapping, sequence, set, shape), each in three tiers (read, mutable, reactive), and carry the whole Form surface of their family. A fabric supplies only how a path is read and written, and which of its refs a descent lands on.
Reactive queries (OnChange and its tree-aware siblings) live in
nu.core.reactive, one interface for every substrate, reached through the
shape Form mixins.
interactions
Module nu.domains.shape.interactions.
Shape fabric queries and commands: all shape interactions in one place.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| AdvanceCursor | scalar_query | AdvanceCursor() | Read the next key after the cursor on an ordered view. |
| Erase | scalar_command | Erase() | Remove the slot-0 structured Ref from its fabric. |
| Exists | scalar_query | Exists() | Yield True if the slot-0 Ref's address is bound (value is not EMPTY). Never EMPTY. |
| Extract | scalar_query | Extract() | Materialise the full subtree at the slot-0 Ref via view.extract(). |
| Load | scalar_query | Load() | Yield the value at the slot-0 Ref; EMPTY if the address is unbound. |
| Missing | scalar_query | Missing() | Yield True if the slot-0 Ref's address is unbound (value is EMPTY). Never EMPTY. |
| PrimitiveSet | scalar_command | PrimitiveSet() | Write the slot-1 value to the slot-0 Ref via _primitive_write. |
| SetCmd | scalar_command | SetCmd() | Write the slot-1 value to the slot-0 structured Ref's address. |
item
Module nu.domains.shape.item.
Leaf family: a single value in a shape fabric, with no descent below it.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| ItemRef | ref | ItemRef(address, parent_ref=None, owner_shape=None) | Leaf Ref: single typed value, no child descent. |
| MutableItemRef | ref | MutableItemRef(address, parent_ref=None, owner_shape=None) | Mutable leaf Ref: single typed value with write/erase. |
| ReactiveItemRef | ref | ReactiveItemRef(address, parent_ref=None, owner_shape=None) | Reactive leaf Ref: single typed value with observation. |
mapping
Module nu.domains.shape.mapping.
Mapping family: a key-value collection in a shape fabric.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MappingRef | ref | MappingRef(address, parent_ref=None, owner_shape=None) | Key-value container Ref; ref[key] navigates to the value's child Ref. |
| MutableMappingRef | ref | MutableMappingRef(address, parent_ref=None, owner_shape=None) | Mutable key-value container Ref. |
| ReactiveMappingRef | ref | ReactiveMappingRef(address, parent_ref=None, owner_shape=None) | Reactive key-value container Ref. |
sequence
Module nu.domains.shape.sequence.
Sequence family: an ordered collection in a shape fabric.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableSequenceRef | ref | MutableSequenceRef(address, parent_ref=None, owner_shape=None) | Mutable ordered container Ref. |
| ReactiveSequenceRef | ref | ReactiveSequenceRef(address, parent_ref=None, owner_shape=None) | Reactive ordered container Ref. |
| SequenceRef | ref | SequenceRef(address, parent_ref=None, owner_shape=None) | Ordered container Ref; ref[i] navigates to the element's child Ref. |
set_
Module nu.domains.shape.set_.
Set family: an unordered collection of unique elements in a shape fabric.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableSetRef | ref | MutableSetRef(address, parent_ref=None, owner_shape=None) | Mutable unordered unique-element container Ref. |
| ReactiveSetRef | ref | ReactiveSetRef(address, parent_ref=None, owner_shape=None) | Reactive unordered unique-element container Ref. |
| SetRef | ref | SetRef(address, parent_ref=None, owner_shape=None) | Unordered unique-element container Ref; no child descent. |
shape
Module nu.domains.shape.shape.
Shape family: a nested Shape in a shape fabric, navigated by slot name.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| MutableShapeRef | ref | MutableShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Mutable structured container Ref. |
| ReactiveShapeRef | ref | ReactiveShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Reactive structured container Ref. |
| ShapeRef | ref | ShapeRef(address, shape_type, parent_ref=None, owner_shape=None) | Structured container Ref; slot navigation via attribute or bracket access. |
base
Module nu.domains.shape.base.
The address chain every shape ref is: a parent on the tree, then its own address.
| Name | Sort | Call | Meaning |
|---|---|---|---|
| StructuredRef | ref | StructuredRef(address, parent_ref=None, owner_shape=None) | Abstract base for shape-fabric Refs. |
| root_shape | shape.root_shape(ref) | The Shape class a Ref chain is rooted at. |
rewrite
Module nu.domains.shape.rewrite.
Re-rooting: splice every bare ref chain in a tree under a new parent.