Trait FromParallelIterator
pub 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 *;
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 ()impl FromParallelIterator<Box<str>> for Box<str>impl FromParallelIterator<Box<str>> for Stringimpl FromParallelIterator<OsString> for OsStringimpl FromParallelIterator<String> for Box<str>impl FromParallelIterator<String> for Stringimpl FromParallelIterator<char> for Box<str>impl FromParallelIterator<char> for Stringimpl<'a> FromParallelIterator<&'a OsStr> for OsStringimpl<'a> FromParallelIterator<&'a char> for Box<str>impl<'a> FromParallelIterator<&'a char> for Stringimpl<'a> FromParallelIterator<&'a str> for Box<str>impl<'a> FromParallelIterator<&'a str> for Stringimpl<'a> FromParallelIterator<Cow<'a, OsStr>> for OsStringimpl<'a> FromParallelIterator<Cow<'a, str>> for Box<str>impl<'a> FromParallelIterator<Cow<'a, str>> for Stringimpl<'a, C, T> FromParallelIterator<T> for Cow<'a, C> where C: ToOwned<Owned: FromParallelIterator<T>> + ?Sized, T: Send,impl<A, B, FromA, FromB> FromParallelIterator<(A, B)> for (FromA, FromB) where A: Send, B: Send, FromA: Send + FromParallelIterator<A>, FromB: Send + FromParallelIterator<B>,impl<C, T> FromParallelIterator<Option<T>> for Option<C> where C: FromParallelIterator<T>, T: Send,impl<C, T, E> FromParallelIterator<Result<T, E>> for Result<C, E> where C: FromParallelIterator<T>, T: Send, E: Send,impl<K, V> FromParallelIterator<(K, V)> for BTreeMap<K, V> where K: Ord + Send, V: Send,impl<K, V, S> FromParallelIterator<(K, V)> for HashMap<K, V, S> where K: Eq + Hash + Send, V: Send, S: BuildHasher + Default + Send,impl<L, R, A, B> FromParallelIterator<Either<L, R>> for (A, B) where L: Send, R: Send, A: Send + FromParallelIterator<L>, B: Send + FromParallelIterator<R>,impl<T> FromParallelIterator<T> for Arc<[T]> where T: Send,impl<T> FromParallelIterator<T> for BinaryHeap<T> where T: Ord + Send,impl<T> FromParallelIterator<T> for Box<[T]> where T: Send,impl<T> FromParallelIterator<T> for LinkedList<T> where T: Send,impl<T> FromParallelIterator<T> for Rc<[T]> where T: Send,impl<T> FromParallelIterator<T> for Vec<T> where T: Send,impl<T> FromParallelIterator<T> for VecDeque<T> where T: Send,impl<V> FromParallelIterator<V> for BTreeSet<V> where V: Send + Ord,impl<V, S> FromParallelIterator<V> for HashSet<V, S> where V: Eq + Hash + Send, S: BuildHasher + Default + Send,