[−][src]Struct trees::bfs::BfsForest
Forest iterator for breadth first search.
Fields
iter: Iter
size: Size
Implementations
impl<Item, Iter> BfsForest<Splitted<Iter>> where
Iter: Iterator<Item = Item>,
[src]
Iter: Iterator<Item = Item>,
pub fn from<Treelike>(treelike: Treelike, size: Size) -> Self where
Treelike: IntoIterator<Item = Item, IntoIter = Iter>,
[src]
Treelike: IntoIterator<Item = Item, IntoIter = Iter>,
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]
Iter: Iterator<Item = Visit<T>>,
F: FnMut(T) -> B,
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
Auto Trait Implementations
impl<Iter> RefUnwindSafe for BfsForest<Iter> where
Iter: RefUnwindSafe,
[src]
Iter: RefUnwindSafe,
impl<Iter> Send for BfsForest<Iter> where
Iter: Send,
[src]
Iter: Send,
impl<Iter> Sync for BfsForest<Iter> where
Iter: Sync,
[src]
Iter: Sync,
impl<Iter> Unpin for BfsForest<Iter> where
Iter: Unpin,
[src]
Iter: Unpin,
impl<Iter> UnwindSafe for BfsForest<Iter> where
Iter: UnwindSafe,
[src]
Iter: 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.