Struct dioxus_native_core::real_dom::NodeMut
source · 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.