Trait taffy::TraversePartialTree

source ·
pub trait TraversePartialTree {
    type ChildIter<'a>: Iterator<Item = NodeId>
       where Self: 'a;

    // Required methods
    fn child_ids(&self, parent_node_id: NodeId) -> Self::ChildIter<'_>;
    fn child_count(&self, parent_node_id: NodeId) -> usize;
    fn get_child_id(&self, parent_node_id: NodeId, child_index: usize) -> NodeId;
}
Expand description

Taffy’s abstraction for downward tree traversal.

However, this trait does not require access to any node’s other than a single container node’s immediate children unless you also intend to implement TraverseTree.

Required Associated Types§

source

type ChildIter<'a>: Iterator<Item = NodeId> where Self: 'a

Type representing an iterator of the children of a node

Required Methods§

source

fn child_ids(&self, parent_node_id: NodeId) -> Self::ChildIter<'_>

Get the list of children IDs for the given node

source

fn child_count(&self, parent_node_id: NodeId) -> usize

Get the number of children for the given node

source

fn get_child_id(&self, parent_node_id: NodeId, child_index: usize) -> NodeId

Get a specific child of a node, where the index represents the nth child

Object Safety§

This trait is not object safe.

Implementors§