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§
fn root_id(&self) -> Key
sourcefn children_of(&mut self, node_id: &Key) -> Vec<Key>
fn children_of(&mut self, node_id: &Key) -> Vec<Key>
Get the children of a Node
sourcefn is_node_valid(&mut self, node_id: &Key) -> bool
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§
sourcefn closest_common_parent(&self, node_a: &Key, node_b: &Key) -> Option<Key>
fn closest_common_parent(&self, node_a: &Key, node_b: &Key) -> Option<Key>
Get the closest common parent Node of two Nodes