Trait outils::tree::traversal::Traversable[][src]

pub trait Traversable<V, Ix = DefaultIndexType> where
    V: ValueType,
    Ix: IndexType
{ fn root(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>;
fn value(&self, node: NodeIndex<Ix>) -> Option<&V>;
fn value_mut(&mut self, node: NodeIndex<Ix>) -> Option<&mut V>;
fn parent(&self, node: NodeIndex<Ix>) -> Option<NodeIndex<Ix>>;
fn child(&self, node: NodeIndex<Ix>, pos: usize) -> Option<NodeIndex<Ix>>;
fn child_count(&self, node: NodeIndex<Ix>) -> usize;
fn node_count(&self) -> usize; }

This trait defines the interface for using the traversal iterators provided by this module.

Required Methods

Returns the index of the root node of the tree containing the tree node indexed by node.

Immutably access the value stored in the tree node indexed by node.

Mutably access the value stored in the tree node indexed by node.

Returns the index of parent node tree node indexed by node.

Returns the index of the child node at position pos of the tree node indexed by node.

Returns the number of child nodes of the tree node indexed by node.

Returns the total number of tree nodes of the tree self.

Implementors