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]
T: PartialEq,
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
impl<T: Debug> Debug for ArenaTree<T> where
T: PartialEq,
[src]
T: PartialEq,
impl<T: Default> Default for ArenaTree<T> where
T: PartialEq,
[src]
T: PartialEq,
Auto Trait Implementations
impl<T> RefUnwindSafe for ArenaTree<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ArenaTree<T> where
T: Send,
T: Send,
impl<T> Sync for ArenaTree<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ArenaTree<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ArenaTree<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,