usesuper::plumbing::*; usesuper::*; usecrate::math::div_round_up; use std::iter; use std::usize;
/// `StepBy` is an iterator that skips `n` elements between each yield, where `n` is the given step. /// This struct is created by the [`step_by()`] method on [`IndexedParallelIterator`] /// /// [`step_by()`]: trait.IndexedParallelIterator.html#method.step_by /// [`IndexedParallelIterator`]: trait.IndexedParallelIterator.html #[must_use = "iterator adaptors are lazy and do nothing unless consumed"] #[derive(Debug, Clone)] pubstruct StepBy<I: IndexedParallelIterator> {
base: I,
step: usize,
}
impl<I> StepBy<I> where
I: IndexedParallelIterator,
{ /// Creates a new `StepBy` iterator. pub(super) fn new(base: I, step: usize) -> Self {
StepBy { base, step }
}
}
impl<I> ParallelIterator for StepBy<I> where
I: IndexedParallelIterator,
{ type Item = I::Item;
fn drive_unindexed<C>(self, consumer: C) -> C::Result where
C: UnindexedConsumer<Self::Item>,
{
bridge(self, consumer)
}
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.