[][src]Struct trees::bfs::BfsForest

pub struct BfsForest<Iter> {
    pub iter: Iter,
    pub size: Size,
}

Forest iterator for breadth first search.

Fields

iter: Itersize: Size

Implementations

impl<Item, Iter> BfsForest<Splitted<Iter>> where
    Iter: Iterator<Item = Item>, 
[src]

pub fn from<Treelike>(treelike: Treelike, size: Size) -> Self where
    Treelike: IntoIterator<Item = Item, IntoIter = Iter>, 
[src]

impl<Iter> BfsForest<Iter>[src]

pub fn wrap(self) -> Bfs<Iter>[src]

pub fn map<B, F, T>(self, mut f: F) -> BfsForest<impl Iterator<Item = Visit<B>>> where
    Iter: Iterator<Item = Visit<T>>,
    F: FnMut(T) -> B, 
[src]

Takes a closure and creates another BfsForest which calls that closure on each Visit::data.

Examples

use trees::Forest;

let forest = Forest::<i32>::from_tuple(( 0, (1,2,3), (4,5,6), ));
assert_eq!( Forest::from( forest.bfs() ),
    Forest::<&i32>::from_tuple(( &0, (&1,&2,&3), (&4,&5,&6), )));
assert_eq!( Forest::from( forest.bfs().map( ToOwned::to_owned )),
    Forest::<i32>::from_tuple(( 0, (1,2,3), (4,5,6), )));

Trait Implementations

impl<T, Iter> From<BfsForest<Iter>> for Forest<T> where
    Iter: Iterator<Item = Visit<T>>, 
[src]

Auto Trait Implementations

impl<Iter> RefUnwindSafe for BfsForest<Iter> where
    Iter: RefUnwindSafe
[src]

impl<Iter> Send for BfsForest<Iter> where
    Iter: Send
[src]

impl<Iter> Sync for BfsForest<Iter> where
    Iter: Sync
[src]

impl<Iter> Unpin for BfsForest<Iter> where
    Iter: Unpin
[src]

impl<Iter> UnwindSafe for BfsForest<Iter> where
    Iter: 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.

impl<T> TupleTree<T, ()> for T[src]