pub struct NodeMut<'a, V: FromAnyValue + Send + Sync = ()> { /* private fields */ }
Expand description
A mutable refrence to a node in the RealDom that tracks what States need to be updated
Implementations§
Source§impl<'a, V: FromAnyValue + Send + Sync> NodeMut<'a, V>
impl<'a, V: FromAnyValue + Send + Sync> NodeMut<'a, V>
Sourcepub fn real_dom_mut(&mut self) -> &mut RealDom<V>
pub fn real_dom_mut(&mut self) -> &mut RealDom<V>
Get the real dom this node was created in mutably
Sourcepub fn parent_mut(&mut self) -> Option<NodeMut<'_, V>>
pub fn parent_mut(&mut self) -> Option<NodeMut<'_, V>>
Get the parent of this node mutably
Sourcepub fn get_mut<T: Component<Tracking = Untracked> + Sync + Send>(
&mut self,
) -> Option<ViewEntryMut<'_, T>>
pub fn get_mut<T: Component<Tracking = Untracked> + Sync + Send>( &mut self, ) -> Option<ViewEntryMut<'_, T>>
Get a component from the current node mutably
Sourcepub fn insert<T: Component + Sync + Send>(&mut self, value: T)
pub fn insert<T: Component + Sync + Send>(&mut self, value: T)
Insert a custom component into this node
Note: Components that implement State and are added when the RealDom is created will automatically be created
Sourcepub fn add_child(&mut self, child: NodeId)
pub fn add_child(&mut self, child: NodeId)
Add the given node to the end of this nodes children
Sourcepub fn insert_after(&mut self, old: NodeId)
pub fn insert_after(&mut self, old: NodeId)
Insert this node after the given node
Sourcepub fn insert_before(&mut self, old: NodeId)
pub fn insert_before(&mut self, old: NodeId)
Insert this node before the given node
Sourcepub fn add_event_listener(&mut self, event: &str)
pub fn add_event_listener(&mut self, event: &str)
Add an event listener
Sourcepub fn remove_event_listener(&mut self, event: &str)
pub fn remove_event_listener(&mut self, event: &str)
Remove an event listener
Sourcepub fn node_type_mut(&mut self) -> NodeTypeMut<'_, V>
pub fn node_type_mut(&mut self) -> NodeTypeMut<'_, V>
Get a mutable reference to the type of the current node
Sourcepub fn clone_node(&mut self) -> NodeId
pub fn clone_node(&mut self) -> NodeId
Clone a node and it’s children and returns the id of the new node. This is more effecient than creating the node from scratch because it can pre-allocate the memory required.