pub struct NodeMut<'a> { /* private fields */ }Expand description
Zero-cost validated mutable handle to a single live node (2 registers: &mut NodeStore +
NodeIndex).
Created via [Transaction::spawn] or [Transaction::node_mut], validating liveness once so
multiple table edits / property writes on the same node skip repeated checks.
Implementations§
Source§impl<'a> NodeMut<'a>
impl<'a> NodeMut<'a>
pub fn index(&self) -> NodeIndex
pub fn id(&self) -> NodeId
pub fn as_ref(&self) -> NodeRef<'_>
Sourcepub fn edit<T: NvTable>(&mut self) -> T::Mut<'_>
pub fn edit<T: NvTable>(&mut self) -> T::Mut<'_>
Fluent typed writer for T on this node (skips repeated liveness/generation checks).
Sourcepub fn attach<T: NvTable>(&mut self) -> &mut Self
pub fn attach<T: NvTable>(&mut self) -> &mut Self
Attaches T with its defaults (no-op if attached).
Sourcepub fn set<T: NvTable, V: ScalarField>(
&mut self,
prop: Prop<T, V>,
value: V,
) -> &mut Self
pub fn set<T: NvTable, V: ScalarField>( &mut self, prop: Prop<T, V>, value: V, ) -> &mut Self
Sets one scalar or wide-optional property on this node.
Sourcepub fn set_str<T: NvTable>(&mut self, prop: StrProp<T>, text: &str) -> &mut Self
pub fn set_str<T: NvTable>(&mut self, prop: StrProp<T>, text: &str) -> &mut Self
Sets one string property on this node.
Sourcepub fn set_resource<T: NvTable, R: FlatResource>(
&mut self,
prop: ResProp<T, R>,
value: Option<&R>,
) -> &mut Self
pub fn set_resource<T: NvTable, R: FlatResource>( &mut self, prop: ResProp<T, R>, value: Option<&R>, ) -> &mut Self
Sets (interning) or clears one resource property on this node.
Sourcepub fn set_resource_id<T: NvTable, R: FlatResource>(
&mut self,
prop: ResProp<T, R>,
rid: ResourceId,
) -> &mut Self
pub fn set_resource_id<T: NvTable, R: FlatResource>( &mut self, prop: ResProp<T, R>, rid: ResourceId, ) -> &mut Self
Points one resource property on this node at a live ResourceId of type R (or
ResourceId::NONE). Ignores stale, dead, or mismatched-kind ids.
Sourcepub fn set_children(&mut self, children: &[NodeId]) -> &mut Self
pub fn set_children(&mut self, children: &[NodeId]) -> &mut Self
Replaces this node’s ordered child list (zero heap allocations).