[][src]Struct xtree::Tree

pub struct Tree<T> { /* fields omitted */ }

The type representing a Tree

Implementations

impl<T> Tree<T>[src]

pub fn new(data: T) -> Tree<T>[src]

Create a tree only have one node with value

Example

use xtree::Tree;
let tree = Tree::new(3);

!! Use tr! macro to instead

pub fn add_child(&mut self, child: Tree<T>)[src]

Add a child to root

Example

let mut t1 = tr!(1);
let t2 = tr!(2);
t1.add_child(t2);

!! Use '/' operator to instead

pub fn cursor(&self) -> Cursor<'_, T>[src]

Get a immutable Cursor which points the root

pub fn cursor_mut(&mut self) -> CursorMut<'_, T>[src]

Get a mutable Cursor which points the root

pub fn df_iter(&self) -> DfIter<'_, T>

Notable traits for DfIter<'a, T>

impl<'a, T> Iterator for DfIter<'a, T> type Item = &'a T;
[src]

Get a immutable Depth-First iterator

pub fn df_iter_mut(&mut self) -> DfIterMut<'_, T>

Notable traits for DfIterMut<'a, T>

impl<'a, T> Iterator for DfIterMut<'a, T> type Item = &'a mut T;
[src]

Get a mutable Depth-First iterator

pub fn bf_iter(&self) -> BfIter<'_, T>

Notable traits for BfIter<'a, T>

impl<'a, T> Iterator for BfIter<'a, T> type Item = &'a T;
[src]

Get a immutable Breadth-first iterator

pub fn bf_iter_mut(&mut self) -> BfIterMut<'_, T>

Notable traits for BfIterMut<'a, T>

impl<'a, T> Iterator for BfIterMut<'a, T> type Item = &'a mut T;
[src]

Get a mutable Breadth-First iterator

Trait Implementations

impl<T> Div<Tree<T>> for Tree<T>[src]

type Output = Tree<T>

The resulting type after applying the / operator.

Auto Trait Implementations

impl<T> RefUnwindSafe for Tree<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Tree<T> where
    T: Send
[src]

impl<T> Sync for Tree<T> where
    T: Sync
[src]

impl<T> Unpin for Tree<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Tree<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

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

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> 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.