[][src]Struct treelike::example::OwningBinaryTree

pub struct OwningBinaryTree<Content> { /* fields omitted */ }

A basic binary tree that stores its children in Box-es on the heap. Used to show off trees that own the complete data and don't rely on any backing storage.

Trait Implementations

impl<'a, TreeCont> Treelike for &'a OwningBinaryTree<TreeCont>[src]

type Content = &'a TreeCont

The content of the current node. Read more

type ChildIterator = Map<Flatten<Iter<'a, Option<Box<OwningBinaryTree<TreeCont>>>>>, fn(_: &Box<OwningBinaryTree<TreeCont>>) -> &OwningBinaryTree<TreeCont>>

You will have to specify the precise type you use for child iteration. This also implies that you have to move any closures into free standing functions. This is an Iterator over the children, not the contents of the children. Read more

fn left(self) -> Option<Self>[src]

Returns leftmost direct child of this Node. Mostly useful for binary trees.

fn right(self) -> Option<Self>[src]

Returns rightmost direct child of this Node. Mostly useful for binary trees.

fn first(self) -> Self::Content[src]

Recursively traverses the tree to the very first/leftmost node.

fn last(self) -> Self::Content[src]

Recursively traverses the tree to the very last/rightmost node.

fn callback_dft<CB: FnMut(Self::Content, usize), F: FilterBuilder<Self>>(
    self,
    callback: CB,
    child_filter: F
)
[src]

Traverses the tree depth first, post order, i.e. children's contents are visited before their parents. Read more

fn callback_dft_pre<CB: FnMut(Self::Content, usize), F: FilterBuilder<Self>>(
    self,
    callback: CB,
    child_filter: F
)
[src]

like callback_dft but the parents content is visited before the children's. Read more

fn callback_bft<CB: FnMut(Self::Content, usize)>(self, callback: CB)[src]

Traverses the tree breadth-first, i.e. one depth-layer at a time. # Example ``` # use treelike::example::LinTree; # use treelike::Treelike; let base = [3, 4, 5, 6, 7]; let node = LinTree::new(0, &base); Read more

fn callback_bft_filtered<CB: FnMut(Self::Content, usize), F: FilterBuilder<Self>>(
    self,
    callback: CB,
    filter: F
)
[src]

Like callback_bft but allows filtering, thereby disallowing some optimizations. Read more

Important traits for DFT<T, F>
fn iter_dft<F: FilterBuilder<Self>>(self, filter: F) -> DFT<Self, F>[src]

Important traits for DFTP<T, F>
fn iter_dft_pre<F: FilterBuilder<Self>>(self, filter: F) -> DFTP<Self, F>[src]

fn iter_bft<F: FilterBuilder<Self>>(
    self,
    filter: F
) -> Chain<Once<Self::Content>, BFT<Self, F>>
[src]

impl<Content: Default> Default for OwningBinaryTree<Content>[src]

Auto Trait Implementations

impl<Content> Unpin for OwningBinaryTree<Content> where
    Content: Unpin

impl<Content> Send for OwningBinaryTree<Content> where
    Content: Send

impl<Content> Sync for OwningBinaryTree<Content> where
    Content: Sync

Blanket Implementations

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

type Error = Infallible

The type returned in the event of a conversion error.

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

impl<T> From<T> for T[src]

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

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

The type returned in the event of a conversion error.

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

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

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