Type Alias freya::core::prelude::DioxusDOM

source ·
pub type DioxusDOM = RealDom<CustomAttributeValues>;

Aliased Type§

struct DioxusDOM { /* private fields */ }

Implementations

source§

impl<V> RealDom<V>
where V: FromAnyValue + Send + Sync,

source

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

source

pub fn tree_ref(&self) -> View<'_, Node>

Get a reference to the tree.

source

pub fn tree_mut(&self) -> (EntitiesViewMut<'_>, ViewMut<'_, Node>)

Get a mutable reference to the tree.

source

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.

source

pub fn is_node_listening(&self, node_id: &EntityId, event: &EventName) -> bool

source

pub fn get_listeners(&self, event: &EventName) -> Vec<NodeRef<'_, V>>

source

pub fn root_id(&self) -> EntityId

Returns the id of the root node.

source

pub fn contains(&self, id: EntityId) -> bool

Check if a node exists in the dom.

source

pub fn get(&self, id: EntityId) -> Option<NodeRef<'_, V>>

Get a reference to a node.

source

pub fn get_mut(&mut self, id: EntityId) -> Option<NodeMut<'_, V>>

Get a mutable reference to a node.

source

pub fn update_state( &mut self, ctx: Map<dyn Any + Sync + Send>, ) -> (DashSet<EntityId, BuildHasherDefault<FxHasher>>, HashMap<EntityId, NodeMask, FxBuildHasher>)

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.

source

pub fn traverse_depth_first_advanced( &self, f: impl FnMut(NodeRef<'_, V>) -> bool, )

Traverses the dom in a depth first manner, calling the provided function on each node only when the parent function returns true. This is useful to not traverse through text nodes for instance.

source

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.

source

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.

source

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.