[][src]Struct xtree::Cursor

pub struct Cursor<'a, T> { /* fields omitted */ }

A immutable Cursor can freely visit node in tree

Implementations

impl<'a, T> Cursor<'a, T>[src]

pub fn move_child(&mut self, at: usize)[src]

Move this cursor to the specified child

Panics

Panics if 'at' >= children_count()

pub fn move_parent(&mut self)[src]

move this cursor to its parent. Do nothing if it is already in the root node.

pub fn move_root(&mut self)[src]

Move this cursor to its root. Do nothing if it is already in the root node.

pub fn current(&self) -> &'a T[src]

Return the reference to the current

pub fn children_count(&self) -> usize[src]

Get the count of children in current node

pub fn children(&self) -> ChildrenIter<'a, T>

Notable traits for ChildrenIter<'a, T>

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

Get a immutable children iterator

pub fn is_root(&self) -> bool[src]

Return true if current node is the root

pub fn is_leaf(&self) -> bool[src]

Return true if current node is a leaf

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Cursor<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T> Send for Cursor<'a, T> where
    T: Sync
[src]

impl<'a, T> Sync for Cursor<'a, T> where
    T: Sync
[src]

impl<'a, T> Unpin for Cursor<'a, T>[src]

impl<'a, T> UnwindSafe for Cursor<'a, T> where
    T: RefUnwindSafe
[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.