nustack

item

Item (leaf) shape-fabric Forms: three tiers.

Module nu.domains.shape.forms.item.

Item (leaf) shape-fabric Forms: three tiers.

Three tiers that compose into ItemRef / MutableItemRef / ReactiveItemRef:

ItemForm          exists(), missing()
MutableItemForm   + set(), erase()
ReactiveItemForm  + on_change()

Pure Form mixins, no Ref or substrate knowledge. Composed into the shape/refs/* blueprints so the user-facing API comes from these Forms.

No generic peer: the Item trunk is shape-specific (a leaf value in the document model has no pure-Python collection equivalent).

  • No generic type params (T, InterfaceT); Refs are unparameterised.
  • No value_type / interface_cls properties; substrate concern, not Form.
NameCallMeaning
ItemFormItemForm()Slot-level read surface for a leaf value. Ops: exists(), missing().
MutableItemFormMutableItemForm()Slot-level write surface. Adds set(value) and erase().
ReactiveItemFormReactiveItemForm()Slot-level reactive surface. Adds on_change().

ItemForm

Slot-level read surface for a leaf value. Ops: exists(), missing().

ItemForm()

Path nu.domains.shape.forms.ItemForm.

Methods

.exists()

Build an Exists query.

Builds Exists.

Undocumented: example.

.missing()

Build a Missing query.

Builds Missing.

Undocumented: example.

Inherited methods

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

From builtins.object:

CallBuildsMeaning
a < bReturn self<value.
a <= bReturn self<=value.
a == bReturn self==value.
a != bReturn self!=value.
a > bReturn self>value.
a >= bReturn self>=value.

Undocumented: example.

MutableItemForm

Slot-level write surface. Adds set(value) and erase().

MutableItemForm()

Path nu.domains.shape.forms.MutableItemForm.

Methods

.set(value)

Build a SetCmd.

Builds SetCmd.

Arguments

NameTypeDefaultMeaning
valueobject

Undocumented: example.

.erase()

Build an Erase.

Builds Erase.

Undocumented: example.

.init(value)

Set value iff the leaf is currently missing.

Builds IfDo.

Arguments

NameTypeDefaultMeaning
valueobject

Undocumented: example.

Inherited methods

From nu.domains.shape.forms.item.ItemForm:

CallBuildsMeaning
.exists()ExistsBuild an Exists query.
.missing()MissingBuild a Missing query.

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

From builtins.object:

CallBuildsMeaning
a < bReturn self<value.
a <= bReturn self<=value.
a == bReturn self==value.
a != bReturn self!=value.
a > bReturn self>value.
a >= bReturn self>=value.

Undocumented: example.

ReactiveItemForm

Slot-level reactive surface. Adds on_change().

ReactiveItemForm()

Path nu.domains.shape.forms.ReactiveItemForm.

Methods

.on_change()

Subscribe to changes on this leaf.

Builds OnPrimitiveChange.

A leaf yields a scalar, not a view, so the subscription happens on the parent view's child-change channel keyed by this leaf's address. OnPrimitiveChange carries only the leaf ref (self); at runtime it calls ref._afetch_parent and ref._aaddress to resolve the parent view and address, then returns parent.on_child_change(address): one uniform path across substrates, no per-substrate override needed.

Undocumented: example.

Inherited methods

From nu.domains.shape.forms.item.MutableItemForm:

CallBuildsMeaning
.set(value)SetCmdBuild a SetCmd.
.erase()EraseBuild an Erase.
.init(value)IfDoSet value iff the leaf is currently missing.

From nu.domains.shape.forms.item.ItemForm:

CallBuildsMeaning
.exists()ExistsBuild an Exists query.
.missing()MissingBuild a Missing query.

From nu.lang.forms.Form:

CallBuildsMeaning
.is_empty()BoolTrue if this Form yields the EMPTY sentinel.
.is_invalid()BoolTrue if this Form yields the INVALID sentinel.
.is_sentinel()BoolTrue if this Form yields either sentinel (EMPTY or INVALID).
.not_empty()BoolTrue if this Form does not yield EMPTY.
.not_invalid()BoolTrue if this Form does not yield INVALID.

From builtins.object:

CallBuildsMeaning
a < bReturn self<value.
a <= bReturn self<=value.
a == bReturn self==value.
a != bReturn self!=value.
a > bReturn self>value.
a >= bReturn self>=value.

Undocumented: example.

On this page