//! 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;
usecrate::iter::plumbing::*; usecrate::iter::*;
usecrate::vec;
/// Parallel iterator over a binary heap #[derive(Debug, Clone)] pubstruct IntoIter<T: Ord + Send> {
inner: vec::IntoIter<T>,
}
impl<T: Ord + Send> IntoParallelIterator for BinaryHeap<T> { type Item = T; type Iter = IntoIter<T>;
/// Draining parallel iterator that moves out of a binary heap, /// but keeps the total capacity. #[derive(Debug)] pubstruct Drain<'a, T: Ord + Send> {
heap: &'a mut BinaryHeap<T>,
}
impl<'a, T: Ord + Send> ParallelDrainFull for &'a mut BinaryHeap<T> { type Iter = Drain<'a, T>; type Item = T;
impl<'a, T: Ord + Send> Drop for Drain<'a, T> { fn drop(&mutself) { if !self.heap.is_empty() { // We must not have produced, so just call a normal drain to remove the items. self.heap.drain();
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-17)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.