Trait FromParallelIterator
trait FromParallelIterator<T>
where
T: Send
FromParallelIterator implements the creation of a collection
from a ParallelIterator. By implementing
FromParallelIterator for a given type, you define how it will be
created from an iterator.
FromParallelIterator is used through ParallelIterator's collect() method.
Examples
Implementing FromParallelIterator for your type:
use *;
use mem;
let bh: BlackHole = .into_par_iter.collect;
assert_eq!;
Required Methods
fn from_par_iter<I>(par_iter: I) -> Self where I: IntoParallelIterator<Item = T>Creates an instance of the collection from the parallel iterator
par_iter.If your collection is not naturally parallel, the easiest (and fastest) way to do this is often to collect
par_iterinto aLinkedList(viacollect_vec_list) or another intermediate data structure and then sequentially extend your collection. However, a more 'native' technique is to use thepar_iter.foldorpar_iter.fold_withmethods to create the collection. Alternatively, if your collection is 'natively' parallel, you can usepar_iter.for_eachto process each element in turn.
Implementors
impl FromParallelIterator for std::ffi::OsStringimpl<T> FromParallelIterator for Vec<T>impl<T> FromParallelIterator for std::rc::Rc<[T]>impl<L, R, A, B> FromParallelIterator for (A, B)impl<T> FromParallelIterator for std::collections::LinkedList<T>impl FromParallelIterator for Stringimpl<'a> FromParallelIterator for Stringimpl<'a> FromParallelIterator for std::ffi::OsStringimpl<'a> FromParallelIterator for std::ffi::OsStringimpl<T> FromParallelIterator for Box<[T]>impl<C, T> FromParallelIterator for Option<C>impl<K, V, S> FromParallelIterator for std::collections::HashMap<K, V, S>impl FromParallelIterator for Stringimpl<'a> FromParallelIterator for Stringimpl<'a, C, T> FromParallelIterator for std::borrow::Cow<'a, C>impl<C, T, E> FromParallelIterator for Result<C, E>impl<K, V> FromParallelIterator for std::collections::BTreeMap<K, V>impl FromParallelIterator for Stringimpl FromParallelIterator for ()impl<T> FromParallelIterator for std::collections::VecDeque<T>impl<V, S> FromParallelIterator for std::collections::HashSet<V, S>impl<A, B, FromA, FromB> FromParallelIterator for (FromA, FromB)impl<T> FromParallelIterator for std::sync::Arc<[T]>impl<T> FromParallelIterator for std::collections::BinaryHeap<T>impl<V> FromParallelIterator for std::collections::BTreeSet<V>impl<'a> FromParallelIterator for String