[][src]Struct treelike::example::BorrowingBinaryTree

pub struct BorrowingBinaryTree<'a, Content> { /* fields omitted */ }

A basic binary tree that contains references to its children

Trait Implementations

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

type Content = &'a TreeCont

The content of the current node. Read more

type ChildIterator = Cloned<Flatten<Iter<'a, Option<&'a BorrowingBinaryTree<'a, 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<'a, Content: Debug> Debug for BorrowingBinaryTree<'a, Content>[src]

impl<'_, Content: Default> Default for BorrowingBinaryTree<'_, Content>[src]

Auto Trait Implementations

impl<'a, Content> Unpin for BorrowingBinaryTree<'a, Content> where
    Content: Unpin

impl<'a, Content> Sync for BorrowingBinaryTree<'a, Content> where
    Content: Sync

impl<'a, Content> Send for BorrowingBinaryTree<'a, Content> where
    Content: Send + 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]