nustack
ReferenceNudomains

shape

Nu shape fabric: DSL + Ref blueprints (3-tier matrix) + queries/commands.

Module nu.domains.shape.

Nu shape fabric: DSL + Ref blueprints (3-tier matrix) + queries/commands.

  • Shape, ShapeMeta, Slot, SlotDescriptor: the DSL.
  • 21 Ref blueprints for structural navigation and substrate extension (7 families x 3 tiers).
  • SetCmd, Erase: slot-level write commands.
  • Load, Exists, Missing, Extract, AdvanceCursor: slot-level read queries.
  • reroot / rerooter: splice the bare ref chains in a term under a new parent, so a snippet written without a mount point gets one.
  • root_shape: which Shape a Ref chain is rooted at, for code handed a Ref as a location and building its own reads under it.

Reactive queries (OnChange / OnChildChange / OnChildrenChange / OnDescendantsChange / OnPrimitiveChange) live in nu.core.reactive -- one unified interface for every substrate, reached through the shape Form mixins.

Modules

ModuleWhat
nu.domains.shape.formsShape-domain Form chain.

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 a sentinel).
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 a sentinel).
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.

refs.item

Module nu.domains.shape.refs.item.

ItemRef hierarchy: leaf Ref + Form mixin tiers.

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.

refs.mapping

Module nu.domains.shape.refs.mapping.

MappingRef hierarchy: key-value container Ref + Form mixin tiers.

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.

refs.sequence

Module nu.domains.shape.refs.sequence.

SequenceRef hierarchy: ordered container Ref + Form mixin tiers.

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.

refs.set_

Module nu.domains.shape.refs.set_.

SetRef hierarchy: unordered unique-element container Ref + Form mixin tiers.

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.

refs.shape

Module nu.domains.shape.refs.shape.

ShapeRef hierarchy: structured container Ref with named-slot navigation.

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.

refs.shapes_mapping

Module nu.domains.shape.refs.shapes_mapping.

ShapesMappingRef hierarchy: mapping-of-shapes Ref + Form mixin tiers.

Full entries

NameSortCallMeaning
MutableShapesMappingRefrefMutableShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None)Mutable mapping-of-shapes Ref; subscript returns MutableShapeRef.
ReactiveShapesMappingRefrefReactiveShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None)Reactive mapping-of-shapes Ref; subscript returns ReactiveShapeRef.
ShapesMappingRefrefShapesMappingRef(address, item_shape_type, parent_ref=None, owner_shape=None)Mapping-of-shapes Ref; subscript descent returns a ShapeRef.

refs.shapes_sequence

Module nu.domains.shape.refs.shapes_sequence.

ShapesSequenceRef hierarchy: sequence-of-shapes Ref + Form mixin tiers.

Full entries

NameSortCallMeaning
MutableShapesSequenceRefrefMutableShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None)Mutable sequence-of-shapes Ref; subscript returns MutableShapeRef.
ReactiveShapesSequenceRefrefReactiveShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None)Reactive sequence-of-shapes Ref; subscript returns ReactiveShapeRef.
ShapesSequenceRefrefShapesSequenceRef(address, item_shape_type, parent_ref=None, owner_shape=None)Sequence-of-shapes Ref; subscript descent returns a ShapeRef.

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.

refs.base

Module nu.domains.shape.refs.base.

StructuredRef: abstract base for all shape-fabric Refs.

Full entries

NameCallMeaning
root_shapeshape.root_shape(ref)The Shape class a Ref chain is rooted at.

On this page