Skip to main content

NodeMut

Struct NodeMut 

Source
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>

Source

pub fn index(&self) -> NodeIndex

Source

pub fn id(&self) -> NodeId

Source

pub fn as_ref(&self) -> NodeRef<'_>

Source

pub fn edit<T: NvTable>(&mut self) -> T::Mut<'_>

Fluent typed writer for T on this node (skips repeated liveness/generation checks).

Source

pub fn attach<T: NvTable>(&mut self) -> &mut Self

Attaches T with its defaults (no-op if attached).

Source

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.

Source

pub fn set_str<T: NvTable>(&mut self, prop: StrProp<T>, text: &str) -> &mut Self

Sets one string property on this node.

Source

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.

Source

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.

Source

pub fn set_children(&mut self, children: &[NodeId]) -> &mut Self

Replaces this node’s ordered child list (zero heap allocations).

Source

pub fn detach<T: NvTable>(&mut self) -> &mut Self

Detaches table T from this node.

Source

pub fn remove(self)

Removes this node and its subtree.

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for NodeMut<'a>

§

impl<'a> Forget for NodeMut<'a>

§

impl<'a> Freeze for NodeMut<'a>
where &'a mut NodeStore: Freeze,

§

impl<'a> Move for NodeMut<'a>

§

impl<'a> RefUnwindSafe for NodeMut<'a>

§

impl<'a> Send for NodeMut<'a>
where RawVecInner: Send, &'static TableDesc: Send, Arc<OwnedTableDesc>: Send, OnceLock<TypeId>: Send, RawTable<((u64, u64), ResourceId)>: Send,

§

impl<'a> Sync for NodeMut<'a>
where RawVecInner: Sync, Arc<OwnedTableDesc>: Sync, OnceLock<TypeId>: Sync, RawTable<((u64, u64), ResourceId)>: Sync,

§

impl<'a> Unpin for NodeMut<'a>
where &'a mut NodeStore: Unpin,

§

impl<'a> UnsafeUnpin for NodeMut<'a>
where &'a mut NodeStore: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.