[][src]Struct lz_eytzinger_tree::EytzingerTree

pub struct EytzingerTree<N> { /* fields omitted */ }

An Eytzinger tree is an N-tree stored in an array structure.

Methods

impl<N> EytzingerTree<N>
[src]

pub fn new(max_children_per_node: usize) -> Self
[src]

Creates a new Eytzinger tree with the specified maximum number of child nodes per parent.

Returns

The new Eytzinger tree.

Important traits for DepthFirstIter<'a, N>
pub fn depth_first_iter(&self, order: DepthFirstOrder) -> DepthFirstIter<N>
[src]

Gets a depth-first iterator over all nodes.

Important traits for BreadthFirstIter<'a, N>
pub fn breadth_first_iter(&self) -> BreadthFirstIter<N>
[src]

Gets a breadth-first iterator over all nodes.

Important traits for DepthFirstIterator<N>
pub fn into_depth_first_iterator(
    self,
    order: DepthFirstOrder
) -> DepthFirstIterator<N>
[src]

Important traits for BreadthFirstIterator<N>
pub fn into_breadth_first_iterator(self) -> BreadthFirstIterator<N>
[src]

pub fn is_empty(&self) -> bool
[src]

Gets whether the Eytzinger tree is empty.

pub fn len(&self) -> usize
[src]

Gets the number of nodes in the Eytzinger tree.

pub fn max_children_per_node(&self) -> usize
[src]

Gets the maximum number of children per parent node.

pub fn clear(&mut self)
[src]

Clears the Eytzinger tree, removing all nodes.

pub fn root(&self) -> Option<Node<N>>
[src]

Gets the root node, None if there was no root node.

The root node may be set with set_root_value.

pub fn root_mut(&mut self) -> Option<NodeMut<N>>
[src]

Gets the mutable root node, None if there was no root node.

The root node may be set with set_root_value.

pub fn set_root_value(&mut self, new_value: N) -> NodeMut<N>
[src]

Sets the value of the root node. All child nodes will remain as they are.

Returns

The new root node.

pub fn remove_root_value(&mut self) -> (Option<N>, VacantEntry<N>)
[src]

Removes the root value. This will also remove all children.

Returns

The old root value if there was one.

pub fn root_entry(&mut self) -> Entry<N>
[src]

Gets the entry for the root node.

Examples

use lz_eytzinger_tree::{EytzingerTree, entry::Entry};

let tree = {
    let mut tree = EytzingerTree::<u32>::new(8);
    tree.root_entry().or_insert(5);
    tree
};

let root = tree.root().unwrap();
assert_eq!(root.value(), &5);

pub fn map<U, F>(self, f: F) -> EytzingerTree<U> where
    F: FnMut(N) -> U, 
[src]

Builds a new EytzingerTree<N> with the values mapped using the specified selector.

Trait Implementations

impl<N: Eq> Eq for EytzingerTree<N>
[src]

impl<N: PartialEq> PartialEq<EytzingerTree<N>> for EytzingerTree<N>
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl<N: Clone> Clone for EytzingerTree<N>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<N: Debug> Debug for EytzingerTree<N>
[src]

impl<N: Hash> Hash for EytzingerTree<N>
[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<N> Send for EytzingerTree<N> where
    N: Send

impl<N> Sync for EytzingerTree<N> where
    N: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]