| //! This module contains the parallel iterator types for heaps |
| //! (`BinaryHeap<T>`). You will rarely need to interact with it directly |
| //! unless you have need to name one of the iterator types. |
| use std::collections::BinaryHeap; |
| /// Parallel iterator over a binary heap |
| pub struct IntoIter<T: Ord + Send> { |
| impl<T: Ord + Send> IntoParallelIterator for BinaryHeap<T> { |
| fn into_par_iter(self) -> Self::Iter { |
| inner: Vec::from(self).into_par_iter(), |
| delegate_indexed_iterator! { |
| /// Parallel iterator over an immutable reference to a binary heap |
| pub struct Iter<'a, T: Ord + Sync + 'a> { |
| inner: vec::IntoIter<&'a T>, |
| impl<'a, T: Ord + Sync> Clone for Iter<'a, T> { |
| fn clone(&self) -> Self { |
| inner: self.inner.clone(), |
| &'a BinaryHeap<T> => Iter<'a, T>, |
| delegate_indexed_iterator! { |
| impl<'a, T: Ord + Sync + 'a> |
| // `BinaryHeap` doesn't have a mutable `Iterator` |