[−][src]Struct treelike::example::OwningBinaryTree
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
fn content(self) -> Self::Content
[src]
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 children(self) -> Self::ChildIterator
[src]
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]
self,
callback: CB,
child_filter: F
)
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]
self,
callback: CB,
child_filter: F
)
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]
self,
callback: CB,
filter: F
)
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]
self,
filter: F
) -> Chain<Once<Self::Content>, BFT<Self, F>>
impl<Content: Default> Default for OwningBinaryTree<Content>
[src]
Auto Trait Implementations
impl<Content> Unpin for OwningBinaryTree<Content> where
Content: Unpin,
Content: Unpin,
impl<Content> Send for OwningBinaryTree<Content> where
Content: Send,
Content: Send,
impl<Content> Sync for OwningBinaryTree<Content> where
Content: Sync,
Content: Sync,
Blanket Implementations
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.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,