Trait freya::prelude::DOMAdapter

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§

fn root_id(&self) -> Key

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

Get the Node size

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

Get the height in the DOM of the given Node

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

Get the parent of a Node

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

Get the children of a Node

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§

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

Get the closest common parent Node of two Nodes

Implementors§

§

impl DOMAdapter<usize> for TestingDOM

§

impl DOMAdapter<EntityId> for DioxusDOMAdapter<'_>