pub struct Tree {
    pub nodes: HashMap<i64, Node>,
    pub children: HashMap<i64, HashSet<i64>>,
    /* private fields */
}
Expand description

A simple tree implementation

Fields

nodes: HashMap<i64, Node>children: HashMap<i64, HashSet<i64>>

Implementations

Create a new Tree containing the given nodes.

Add the given nodes to the Tree.

Mark the nodes with this IDs.

Set the format string for all nodes.

Simplify the tree by removing all nodes that have only one child and are not marked.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.