nustack

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.

Full entries

NameSortCallMeaning
AdvanceCursorscalar_queryAdvanceCursor()Read the next key after the cursor on an ordered view.
Erasescalar_commandErase()Remove the slot-0 structured Ref from its fabric.
Existsscalar_queryExists()Yield True if the slot-0 Ref's address is bound (value is not EMPTY). Never EMPTY.
Extractscalar_queryExtract()Materialise the full subtree at the slot-0 Ref via view.extract().
Loadscalar_queryLoad()Yield the value at the slot-0 Ref; EMPTY if the address is unbound.
Missingscalar_queryMissing()Yield True if the slot-0 Ref's address is unbound (value is EMPTY). Never EMPTY.
PrimitiveSetscalar_commandPrimitiveSet()Write the slot-1 value to the slot-0 Ref via _primitive_write.
SetCmdscalar_commandSetCmd()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.

Full entries

NameSortCallMeaning
ItemRefrefItemRef(address, parent_ref=None, owner_shape=None)Leaf Ref: single typed value, no child descent.
MutableItemRefrefMutableItemRef(address, parent_ref=None, owner_shape=None)Mutable leaf Ref: single typed value with write/erase.
ReactiveItemRefrefReactiveItemRef(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.

Full entries

NameSortCallMeaning
MappingRefrefMappingRef(address, parent_ref=None, owner_shape=None)Key-value container Ref; ref[key] navigates to the value's child Ref.
MutableMappingRefrefMutableMappingRef(address, parent_ref=None, owner_shape=None)Mutable key-value container Ref.
ReactiveMappingRefrefReactiveMappingRef(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.

Full entries

NameSortCallMeaning
MutableSequenceRefrefMutableSequenceRef(address, parent_ref=None, owner_shape=None)Mutable ordered container Ref.
ReactiveSequenceRefrefReactiveSequenceRef(address, parent_ref=None, owner_shape=None)Reactive ordered container Ref.
SequenceRefrefSequenceRef(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.

Full entries

NameSortCallMeaning
MutableSetRefrefMutableSetRef(address, parent_ref=None, owner_shape=None)Mutable unordered unique-element container Ref.
ReactiveSetRefrefReactiveSetRef(address, parent_ref=None, owner_shape=None)Reactive unordered unique-element container Ref.
SetRefrefSetRef(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.

Full entries

NameSortCallMeaning
MutableShapeRefrefMutableShapeRef(address, shape_type, parent_ref=None, owner_shape=None)Mutable structured container Ref.
ReactiveShapeRefrefReactiveShapeRef(address, shape_type, parent_ref=None, owner_shape=None)Reactive structured container Ref.
ShapeRefrefShapeRef(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.

Full entries

NameSortCallMeaning
StructuredRefrefStructuredRef(address, parent_ref=None, owner_shape=None)Abstract base for shape-fabric Refs.
root_shapeshape.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.

Full entries

NameCallMeaning
rerootshape.reroot(root, under, rooted=None)Rewrite root so every bare ref chain in it hangs off under.
rerootershape.rerooter(under, rooted=None)reroot with its policy fixed, as a plain Nu -> Nu transform.

On this page