Trait transiter::IntoTransIter [−][src]
pub trait IntoTransIter<T> {
fn trans_iter_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransIter<F, I, T>ⓘ;
fn trans_prio_queue_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransPrioQueue<F, I, T>ⓘNotable traits for TransPrioQueue<F, I, T>impl<F: FnMut(&T) -> I, I: IntoIterator<Item = T>, T: Ord> Iterator for TransPrioQueue<F, I, T> type Item = T;
where
Self: Sized,
T: Ord,
{ ... }
}
Expand description
Create a TransIter directly from some value
This trait defines the trans_iter_with function which, when called on a value, returns a TransIter with an initial set derived from that value.
Example
use transiter::IntoTransIter;
let names: Vec<_> = String::new()
.trans_iter_with(|s| { let s = s.clone(); ["a", "b", "c"].iter().map(move |c| s.clone() + c)})
.take(10)
.collect();
assert_eq!(names, vec!["", "a", "b", "c", "aa", "ab", "ac", "ba", "bb", "bc"]);
Required methods
fn trans_iter_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransIter<F, I, T>ⓘ
fn trans_iter_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransIter<F, I, T>ⓘ
Provided methods
fn trans_prio_queue_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransPrioQueue<F, I, T>ⓘNotable traits for TransPrioQueue<F, I, T>impl<F: FnMut(&T) -> I, I: IntoIterator<Item = T>, T: Ord> Iterator for TransPrioQueue<F, I, T> type Item = T;
where
Self: Sized,
T: Ord,
fn trans_prio_queue_with<F: FnMut(&T) -> I, I: IntoIterator<Item = T>>(
self,
recursion: F
) -> TransPrioQueue<F, I, T>ⓘNotable traits for TransPrioQueue<F, I, T>impl<F: FnMut(&T) -> I, I: IntoIterator<Item = T>, T: Ord> Iterator for TransPrioQueue<F, I, T> type Item = T;
where
Self: Sized,
T: Ord,
Notable traits for TransPrioQueue<F, I, T>
impl<F: FnMut(&T) -> I, I: IntoIterator<Item = T>, T: Ord> Iterator for TransPrioQueue<F, I, T> type Item = T;
Create a TransPrioQueue from this value
Create a TransPrioQueue with an initial set derived from this value and the given recursion function.