pub type DioxusDOM = RealDom<CustomAttributeValues>;
Aliased Type§
struct DioxusDOM { /* private fields */ }
Implementations
§impl<V> RealDom<V>where
V: FromAnyValue + Send + Sync,
impl<V> RealDom<V>where V: FromAnyValue + Send + Sync,
pub fn new(tracked_states: impl Into<Box<[TypeErasedState<V>]>>) -> RealDom<V>
pub fn new(tracked_states: impl Into<Box<[TypeErasedState<V>]>>) -> RealDom<V>
Create a new RealDom with the given states that will be inserted and updated when needed
pub fn tree_ref(&self) -> View<'_, Node>
pub fn tree_ref(&self) -> View<'_, Node>
Get a reference to the tree.
pub fn tree_mut(&self) -> (EntitiesViewMut<'_>, ViewMut<'_, Node>)
pub fn tree_mut(&self) -> (EntitiesViewMut<'_>, ViewMut<'_, Node>)
Get a mutable reference to the tree.
pub fn create_node(&mut self, node: impl Into<NodeType<V>>) -> NodeMut<'_, V>
pub fn create_node(&mut self, node: impl Into<NodeType<V>>) -> NodeMut<'_, V>
Create a new node of the given type in the dom and return a mutable reference to it.
pub fn get_listening_sorted(&self, event: &str) -> Vec<NodeRef<'_, V>>
pub fn get_listening_sorted(&self, event: &str) -> Vec<NodeRef<'_, V>>
Find all nodes that are listening for an event, sorted by there height in the dom progressing starting at the bottom and progressing up. This can be useful to avoid creating duplicate events.
pub fn root_id(&self) -> EntityId
pub fn root_id(&self) -> EntityId
Returns the id of the root node.
pub fn update_state(
&mut self,
ctx: Map<dyn Any + Send + Sync>
) -> (DashSet<EntityId, BuildHasherDefault<FxHasher>>, HashMap<EntityId, NodeMask, BuildHasherDefault<FxHasher>>)
pub fn update_state( &mut self, ctx: Map<dyn Any + Send + Sync> ) -> (DashSet<EntityId, BuildHasherDefault<FxHasher>>, HashMap<EntityId, NodeMask, BuildHasherDefault<FxHasher>>)
Update the state of the dom, after appling some mutations. This will keep the nodes in the dom up to date with their VNode counterparts.
pub fn traverse_depth_first_advanced(
&self,
enter_shadow_dom: bool,
f: impl FnMut(NodeRef<'_, V>)
)
pub fn traverse_depth_first_advanced( &self, enter_shadow_dom: bool, f: impl FnMut(NodeRef<'_, V>) )
Traverses the dom in a depth first manner, calling the provided function on each node.
If enter_shadow_dom
is true, then the traversal will enter shadow doms in the tree.
pub fn traverse_depth_first(&self, f: impl FnMut(NodeRef<'_, V>))
pub fn traverse_depth_first(&self, f: impl FnMut(NodeRef<'_, V>))
Traverses the dom in a depth first manner, calling the provided function on each node.
pub fn traverse_breadth_first_advanced(
&self,
enter_shadow_doms: bool,
f: impl FnMut(NodeRef<'_, V>)
)
pub fn traverse_breadth_first_advanced( &self, enter_shadow_doms: bool, f: impl FnMut(NodeRef<'_, V>) )
Traverses the dom in a breadth first manner, calling the provided function on each node.
If enter_shadow_dom
is true, then the traversal will enter shadow doms in the tree.
pub fn traverse_breadth_first(&self, f: impl FnMut(NodeRef<'_, V>))
pub fn traverse_breadth_first(&self, f: impl FnMut(NodeRef<'_, V>))
Traverses the dom in a breadth first manner, calling the provided function on each node.
pub fn traverse_depth_first_mut_advanced(
&mut self,
enter_shadow_doms: bool,
f: impl FnMut(NodeMut<'_, V>)
)
pub fn traverse_depth_first_mut_advanced( &mut self, enter_shadow_doms: bool, f: impl FnMut(NodeMut<'_, V>) )
Traverses the dom in a depth first manner mutably, calling the provided function on each node.
If enter_shadow_dom
is true, then the traversal will enter shadow doms in the tree.
pub fn traverse_depth_first_mut(&mut self, f: impl FnMut(NodeMut<'_, V>))
pub fn traverse_depth_first_mut(&mut self, f: impl FnMut(NodeMut<'_, V>))
Traverses the dom in a depth first manner mutably, calling the provided function on each node.
pub fn traverse_breadth_first_mut_advanced(
&mut self,
enter_shadow_doms: bool,
f: impl FnMut(NodeMut<'_, V>)
)
pub fn traverse_breadth_first_mut_advanced( &mut self, enter_shadow_doms: bool, f: impl FnMut(NodeMut<'_, V>) )
Traverses the dom in a breadth first manner mutably, calling the provided function on each node.
If enter_shadow_dom
is true, then the traversal will enter shadow doms in the tree.
pub fn traverse_breadth_first_mut(&mut self, f: impl FnMut(NodeMut<'_, V>))
pub fn traverse_breadth_first_mut(&mut self, f: impl FnMut(NodeMut<'_, V>))
Traverses the dom in a breadth first manner mutably, calling the provided function on each node.
pub fn add_node_watcher(
&mut self,
watcher: impl NodeWatcher<V> + Send + Sync + 'static
)
pub fn add_node_watcher( &mut self, watcher: impl NodeWatcher<V> + Send + Sync + 'static )
Adds a [NodeWatcher
] to the dom. Node watchers are called whenever a node is created or removed.
pub fn add_attribute_watcher(
&mut self,
watcher: impl AttributeWatcher<V> + Send + Sync + 'static
)
pub fn add_attribute_watcher( &mut self, watcher: impl AttributeWatcher<V> + Send + Sync + 'static )
Adds an [AttributeWatcher
] to the dom. Attribute watchers are called whenever an attribute is changed.
pub fn raw_world(&self) -> &World
pub fn raw_world(&self) -> &World
Returns a reference to the underlying world. Any changes made to the world will not update the reactive system.
pub fn raw_world_mut(&mut self) -> &mut World
pub fn raw_world_mut(&mut self) -> &mut World
Returns a mutable reference to the underlying world. Any changes made to the world will not update the reactive system.
pub fn register_custom_element<E>(&mut self)where
E: CustomElement<V>,
pub fn register_custom_element<E>(&mut self)where E: CustomElement<V>,
Registers a new custom element.
pub fn register_custom_element_with_factory<F, U>(&mut self)where
F: CustomElementFactory<U, V>,
U: CustomElementUpdater<V>,
pub fn register_custom_element_with_factory<F, U>(&mut self)where F: CustomElementFactory<U, V>, U: CustomElementUpdater<V>,
Registers a new custom element with a custom factory.