//! This module contains the parallel iterator types for owned strings //! (`String`). You will rarely need to interact with it directly //! unless you have need to name one of the iterator types.
usecrate::iter::plumbing::*; usecrate::math::simplify_range; usecrate::prelude::*; use std::ops::{Range, RangeBounds};
impl<'a> ParallelDrainRange<usize> for &'a mut String { type Iter = Drain<'a>; type Item = char;
/// Draining parallel iterator that moves a range of characters out of a string, /// but keeps the total capacity. #[derive(Debug)] pubstruct Drain<'a> {
string: &'a mut String,
range: Range<usize>,
}
impl<'a> ParallelIterator for Drain<'a> { type Item = char;
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
{ self.string[self.range.clone()]
.par_chars()
.drive_unindexed(consumer)
}
}
impl<'a> Drop for Drain<'a> { fn drop(&mutself) { // Remove the drained range. self.string.drain(self.range.clone());
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-18)
¤
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.