Struct light_phylogeny::ArenaTree [−][src]
Structure ArenaTree.
Taken 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
impl<T> ArenaTree<T> where
T: PartialEq,
[src]
impl<T> ArenaTree<T> where
T: PartialEq,
[src]pub fn node(&mut self, val: T) -> usize
[src]
Add a node and send its new index. If the node already exists, send its index.
pub fn new_node(&mut self, val: T) -> usize
[src]
Add a node and send its new index. If the node already exists, send a panic alert.
pub fn get_index(&mut self, name: String) -> Result<usize, usize>
[src]
Get index of a node from its name
pub fn get_root(&mut self) -> usize
[src]
Get the index of the root.
pub fn is_leaf(&self, idx: usize) -> bool
[src]
Check if the node is a leaf.
pub fn is_left(&self, idx: usize) -> bool
[src]
Check if the node is a left node.
pub fn is_root(&self, idx: usize) -> bool
[src]
Check if the node is the root.
pub fn depth(&self, idx: usize) -> usize
[src]
Get the depth of the node in the tree.
pub fn get_largest_x(&mut self) -> f32
[src]
Get the largest x value of a tree.
pub fn get_largest_y(&mut self) -> f32
[src]
Get the largest y value of a tree.
pub fn get_smallest_x(&mut self) -> f32
[src]
Get the smallest x value of a tree.
pub fn get_smallest_y(&mut self) -> f32
[src]
Get the smallest y value of a tree.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for ArenaTree<T> where
T: RefUnwindSafe,
impl<T> RefUnwindSafe for ArenaTree<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for ArenaTree<T> where
T: UnwindSafe,
impl<T> UnwindSafe for ArenaTree<T> where
T: UnwindSafe,