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§
Required Methods§
sourcefn child_ids(&self, parent_node_id: NodeId) -> Self::ChildIter<'_>
fn child_ids(&self, parent_node_id: NodeId) -> Self::ChildIter<'_>
Get the list of children IDs for the given node
sourcefn child_count(&self, parent_node_id: NodeId) -> usize
fn child_count(&self, parent_node_id: NodeId) -> usize
Get the number of children for the given node
sourcefn get_child_id(&self, parent_node_id: NodeId, child_index: usize) -> NodeId
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.