Trait freya::prelude::DOMAdapter

source ·
pub trait DOMAdapter<Key>
where Key: NodeKey,
{ // Required methods fn root_id(&self) -> Key; fn get_node(&self, node_id: &Key) -> Option<Node>; fn height(&self, node_id: &Key) -> Option<u16>; fn parent_of(&self, node_id: &Key) -> Option<Key>; fn children_of(&mut self, node_id: &Key) -> Vec<Key>; fn is_node_valid(&mut self, node_id: &Key) -> bool; // Provided method fn closest_common_parent(&self, node_a: &Key, node_b: &Key) -> Option<Key> { ... } }

Required Methods§

source

fn root_id(&self) -> Key

source

fn get_node(&self, node_id: &Key) -> Option<Node>

Get the Node size

source

fn height(&self, node_id: &Key) -> Option<u16>

Get the height in the DOM of the given Node

source

fn parent_of(&self, node_id: &Key) -> Option<Key>

Get the parent of a Node

source

fn children_of(&mut self, node_id: &Key) -> Vec<Key>

Get the children of a Node

source

fn is_node_valid(&mut self, node_id: &Key) -> bool

Check whether the given Node is valid (isn’t a placeholder, unconnected node..)

Provided Methods§

source

fn closest_common_parent(&self, node_a: &Key, node_b: &Key) -> Option<Key>

Get the closest common parent Node of two Nodes

Implementations on Foreign Types§

source§

impl DOMAdapter<EntityId> for DioxusDOMAdapter<'_>

source§

fn get_node(&self, node_id: &EntityId) -> Option<Node>

source§

fn height(&self, node_id: &EntityId) -> Option<u16>

source§

fn parent_of(&self, node_id: &EntityId) -> Option<EntityId>

source§

fn children_of(&mut self, node_id: &EntityId) -> Vec<EntityId>

source§

fn is_node_valid(&mut self, node_id: &EntityId) -> bool

source§

fn root_id(&self) -> EntityId

Implementors§