[−][src]Struct xtree::Tree
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>ⓘ
[src]
Get a immutable Depth-First iterator
pub fn df_iter_mut(&mut self) -> DfIterMut<'_, T>ⓘ
[src]
Get a mutable Depth-First iterator
pub fn bf_iter(&self) -> BfIter<'_, T>ⓘ
[src]
Get a immutable Breadth-first iterator
pub fn bf_iter_mut(&mut self) -> BfIterMut<'_, T>ⓘ
[src]
Get a mutable Breadth-First iterator
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Tree<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Tree<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Tree<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Tree<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Tree<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,