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]

[src]

Returns an iterator over node values in creation order.

[src]

Returns a mutable iterator over node values in creation order.

[src]

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

[src]

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

impl<T> Tree<T>
[src]

[src]

Creates a new tree with a root node.

[src]

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

[src]

Returns a reference to the root node.

[src]

Returns a mutator of the root node.

[src]

Creates an orphan node, returning a mutator of it.

[src]

Returns a reference to the specified node.

Panics

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

[src]

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]

[src]

Formats the value using the given formatter.

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

[src]

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

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

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

1.0.0
[src]

This method tests for !=.