Trait torin::dom_adapter::DOMAdapter

source ·
pub trait DOMAdapter<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

Implementors§