Struct ego_tree::Tree [] [src]

pub struct Tree<T> { /* fields omitted */ }

A Vec-backed tree.

Nodes are allocated in a Vec which is only ever pushed to. NodeId is an opaque index into the Vec.

Each Tree has a unique ID which is also given to each NodeId it creates. This is used to bounds check a NodeId.

Methods

impl<T> Tree<T>
[src]

Returns an iterator over node values in creation order.

Returns a mutable iterator over node values in creation order.

Returns an iterator that moves node values out of the tree in creation order.

Returns an iterator over all nodes, including orphans, in creation order.

impl<T> Tree<T>
[src]

Creates a new tree with a root node.

Creates a new tree of the specified capacity with a root node.

Returns a reference to the root node.

Returns a mutator of the root node.

Creates an orphan node, returning a mutator of it.

Returns a reference to the specified node.

Panics

Panics if id does not refer to a node in this tree.

Returns a mutator of the specified node.

Panics

Panics if id does not refer to a node in this tree.

Trait Implementations

impl<T: Debug> Debug for Tree<T>
[src]

Formats the value using the given formatter.

impl<T: Default> Default for Tree<T>
[src]

Returns the "default value" for a type. Read more

impl<T: Clone> Clone for Tree<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: Eq> Eq for Tree<T>
[src]

impl<T: PartialEq> PartialEq for Tree<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.