Trait ParallelDrainFull
trait ParallelDrainFull
ParallelDrainFull creates a parallel iterator that moves all items
from a collection while retaining the original capacity.
Types which are indexable typically implement ParallelDrainRange
instead, where you can drain fully with par_drain(..).
Associated Types
type Iter: TraitBound { trait_: Path { path: "ParallelIterator", id: Id(20), args: Some(AngleBracketed { args: [], constraints: [AssocItemConstraint { name: "Item", args: None, binding: Equality(Type(QualifiedPath { name: "Item", args: None, self_type: Generic("Self"), trait_: Some(Path { path: "", id: Id(3311), args: None }) })) }] }) }, generic_params: [], modifier: None }The draining parallel iterator type that will be created.
type Item: TraitBound { trait_: Path { path: "Send", id: Id(6), args: None }, generic_params: [], modifier: None }The type of item that the parallel iterator will produce. This is usually the same as
IntoParallelIterator::Item.
Required Methods
fn par_drain(self: Self) -> <Self as >::IterReturns a draining parallel iterator over an entire collection.
When the iterator is dropped, all items are removed, even if the iterator was not fully consumed. If the iterator is leaked, for example using
std::mem::forget, it is unspecified how many items are removed.Examples
use *; use ; let squares: = .map.collect; let mut heap: = squares.iter.copied.collect; assert_eq!; assert!; assert!;
Implementors
impl<'a, K: Hash + Eq + Send, V: Send, S: BuildHasher> ParallelDrainFull for &'a mut std::collections::HashMap<K, V, S>impl<'a, T: Hash + Eq + Send, S: BuildHasher> ParallelDrainFull for &'a mut std::collections::HashSet<T, S>impl<'a, T: Ord + Send> ParallelDrainFull for &'a mut std::collections::BinaryHeap<T>