pub struct ArenaTree<T> where
    T: PartialEq
{ pub arena: Vec<Noeud<T>>, }
Expand description

ArenaTree Structure. It describes a binary phylogenetic tree.

Inspirated from https://dev.to/deciduously/no-more-tears-no-more-knots-arena-allocated-trees-in-rust-44k6

Ben Lovy https://deciduously.com/

Fields

arena: Vec<Noeud<T>>

Implementations

Add a node with a given val and send its new index. If the node already exists, send its index.

Add a node with a given val and send its new index. If the node already exists, send a panic alert.

Get the index of a node from its val. If the node does not exists, send a panic alert.

Get the index of a node from its name. Send a Result(index, error)

Get the index of the root.

Check if the node is a leaf.

Check if the node is a left node.

Check if the node is the root.

Get the depth of the node in the tree.

Get the largest x value of a tree.

Get the largest y value of a tree.

Get the largest y value of a tree execpt the free living part.

Get the smallest x value of a tree.

Get the smallest y value of a tree.

Get the smallest l value of a tree.

Get the largest height .

Copy a whole ArenaTree structure.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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

Performs the conversion.

Performs the conversion.

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.