Trait StepByImpl
pub(in ::iter::adapters::step_by) unsafe trait StepByImpl<I>
Specialization trait to optimize StepBy<Range<{integer}>> iteration.
Safety
Technically this is safe to implement (look ma, no unsafe!), but in reality a lot of unsafe code relies on ranges over integers being correct.
For correctness all public StepBy methods must be specialized
because setup drastically alters the meaning of the struct fields so that mixing
different implementations would lead to incorrect results.
Associated Types
type Item;
Required Methods
fn spec_next(&mut self) -> Option<Self::Item>fn spec_size_hint(&self) -> (usize, Option<usize>)fn spec_nth(&mut self, n: usize) -> Option<Self::Item>fn spec_try_fold<Acc, F, R>(&mut self, acc: Acc, f: F) -> R where F: FnMut(Acc, Self::Item) -> R, R: Try<Output = Acc>,fn spec_fold<Acc, F>(self, acc: Acc, f: F) -> Acc where F: FnMut(Acc, Self::Item) -> Acc,
Implementors
impl StepByImpl<Range<u16>> for StepBy<Range<u16>>impl StepByImpl<Range<u32>> for StepBy<Range<u32>>impl StepByImpl<Range<u64>> for StepBy<Range<u64>>impl StepByImpl<Range<u8>> for StepBy<Range<u8>>impl StepByImpl<Range<usize>> for StepBy<Range<usize>>impl StepByImpl<RangeIter<u16>> for StepBy<RangeIter<u16>>impl StepByImpl<RangeIter<u32>> for StepBy<RangeIter<u32>>impl StepByImpl<RangeIter<u64>> for StepBy<RangeIter<u64>>impl StepByImpl<RangeIter<u8>> for StepBy<RangeIter<u8>>impl StepByImpl<RangeIter<usize>> for StepBy<RangeIter<usize>>impl<I: Iterator> StepByImpl<I> for StepBy<I>