pub struct Transaction<'s> { /* private fields */ }Implementations§
Source§impl Transaction<'_>
impl Transaction<'_>
Sourcepub fn commit_into(self, changes: &mut ChangeSet)
pub fn commit_into(self, changes: &mut ChangeSet)
Closes the frame: refills changes in place (zero steady-state allocations) and clears all
per-frame tracking. Removed node indices and released resources are recycled afterwards, so
ids seen in this frame never alias within it.
Methods from Deref<Target = TxCore<'s>>§
Sourcepub fn try_set_children(
&mut self,
parent: NodeId,
new_children: &[NodeId],
) -> bool
pub fn try_set_children( &mut self, parent: NodeId, new_children: &[NodeId], ) -> bool
Validated child-list replacement returning false without mutating the tree if parent is
dead, any child is non-live/NULL, any child is duplicated, or any child would form a cycle.
Fallible version of Self::set_children returning false on dead/NULL/duplicate/cyclic input.
Sourcepub fn set_children(&mut self, parent: NodeId, new_children: &[NodeId])
pub fn set_children(&mut self, parent: NodeId, new_children: &[NodeId])
Replaces the ordered child list of parent (no-op when unchanged or invalid, zero heap
allocations). Rejects dead/null nodes, duplicates, and cycles; detaches moved children from
any previous parent.
Sourcepub fn insert_child(&mut self, parent: NodeId, index: usize, child: NodeId)
pub fn insert_child(&mut self, parent: NodeId, index: usize, child: NodeId)
Inserts child at index (clamped) in parent’s child list, moving it from any previous
parent (zero heap allocations via SpanPool::insert_at). Ignores dead nodes or cycles.
Sourcepub fn append_child(&mut self, parent: NodeId, child: NodeId)
pub fn append_child(&mut self, parent: NodeId, child: NodeId)
Appends child to parent (zero heap allocations).
Sourcepub fn detach_child(&mut self, child: NodeId)
pub fn detach_child(&mut self, child: NodeId)
Detaches child from its parent (the child stays alive).
Sourcepub fn spawn(&mut self) -> NodeMut<'_>
pub fn spawn(&mut self) -> NodeMut<'_>
Allocates a node and returns a validated NodeMut handle for chained zero-check edits.
Sourcepub fn node_mut(&mut self, id: NodeId) -> Option<NodeMut<'_>>
pub fn node_mut(&mut self, id: NodeId) -> Option<NodeMut<'_>>
Validates id once and returns a NodeMut handle (None if dead/stale).
Sourcepub fn create_at(&mut self, id: NodeId) -> bool
pub fn create_at(&mut self, id: NodeId) -> bool
Creates id exactly (replica stores applying a wire frame). Returns false if the slot
is occupied by a live node. O(1) — clears IN_FREE/PENDING_FREE flags without scanning.
Sourcepub fn remove(&mut self, id: NodeId)
pub fn remove(&mut self, id: NodeId)
Removes id and its whole subtree, detaching it from its parent (zero heap allocations
once scratch_stack is warm). Records removed in postorder (descendants before ancestors).
Sourcepub fn edit<T: NvTable>(&mut self, id: NodeId) -> T::Mut<'_>
pub fn edit<T: NvTable>(&mut self, id: NodeId) -> T::Mut<'_>
Fluent typed writer for T on id (attaches T with defaults when absent).
Sourcepub fn attach<T: NvTable>(&mut self, id: NodeId)
pub fn attach<T: NvTable>(&mut self, id: NodeId)
Attaches T with its defaults (no-op if attached).
Sourcepub fn set<T: NvTable, V: ScalarField>(
&mut self,
id: NodeId,
prop: Prop<T, V>,
value: V,
)
pub fn set<T: NvTable, V: ScalarField>( &mut self, id: NodeId, prop: Prop<T, V>, value: V, )
Sets one scalar or wide-optional property.
Sourcepub fn set_str<T: NvTable>(&mut self, id: NodeId, prop: StrProp<T>, text: &str)
pub fn set_str<T: NvTable>(&mut self, id: NodeId, prop: StrProp<T>, text: &str)
Sets one string property.
Sourcepub fn with_temp_resources<R>(
&mut self,
f: impl FnOnce(&mut TempResources<'_>) -> R,
) -> R
pub fn with_temp_resources<R>( &mut self, f: impl FnOnce(&mut TempResources<'_>) -> R, ) -> R
Opens a leak-free temporary resource scope for building nested resources (e.g.
ResponsiveRules / StateRules embedding child BackgroundFillRes / GridTracks).
Sourcepub fn set_resource<T: NvTable, R: FlatResource>(
&mut self,
id: NodeId,
prop: ResProp<T, R>,
value: Option<&R>,
)
pub fn set_resource<T: NvTable, R: FlatResource>( &mut self, id: NodeId, prop: ResProp<T, R>, value: Option<&R>, )
Sets (interned) or clears one resource property.
Sourcepub fn set_resource_with<T: NvTable, R: FlatResource>(
&mut self,
id: NodeId,
prop: ResProp<T, R>,
write: impl FnOnce(&mut Vec<u32>) -> bool,
)
pub fn set_resource_with<T: NvTable, R: FlatResource>( &mut self, id: NodeId, prop: ResProp<T, R>, write: impl FnOnce(&mut Vec<u32>) -> bool, )
Sets (interned) one resource property via a zero-alloc scratch-word closure.
Sourcepub fn set_resource_id<T: NvTable, R: FlatResource>(
&mut self,
id: NodeId,
prop: ResProp<T, R>,
rid: ResourceId,
) -> bool
pub fn set_resource_id<T: NvTable, R: FlatResource>( &mut self, id: NodeId, prop: ResProp<T, R>, rid: ResourceId, ) -> bool
Points one resource property at a live ResourceId of type R (or ResourceId::NONE).
Returns false without mutating if rid is stale, dead, or of a mismatched kind/type.
Sourcepub fn apply_row_patch(&mut self, id: NodeId, patch: RowPatchView<'_>)
pub fn apply_row_patch(&mut self, id: NodeId, patch: RowPatchView<'_>)
Applies every valid table operation in patch onto live node id, attaching a touched
table only when at least one non-metadata op passes word, liveness, and resource-kind
checks. On #[nv_table(inherited)] tables, explicit bits belonging to skipped ops or
forged/orphan word-0 set bits lacking all accompanying data-word ops are masked out before
updating word 0 so rejected or unpatched fields never override inherited values.
Sourcepub fn mark_table_paint_dirty<T: NvTable>(&mut self, id: NodeId)
pub fn mark_table_paint_dirty<T: NvTable>(&mut self, id: NodeId)
Marks an existing row of table T on live node id as paint-dirty without mutating its
authored words, so both ChangeSet::touched (effect::PAINT) and
NvTableView::dirty_owners report it for the current frame (zero steady-state allocations).
Sourcepub fn detach<T: NvTable>(&mut self, id: NodeId)
pub fn detach<T: NvTable>(&mut self, id: NodeId)
Detaches table T from id, releasing its strings and resources.