View all comments
Feature gate: #![feature(iter_next_chunk)]
This is a tracking issue for the .next_chunk() and .next_chunk_back() method on iterators which allows you to advance the iterator N elements and return an array [T; N]
Public API
use core::array;
trait Iterator {
type Item;
fn next_chunk<const N: usize>(&mut self) -> Result<[Self::Item; N], array::IntoIter<Self::Item, N>>
where
Self: Sized;
}
trait DoubleEndedIterator {
fn next_chunk_back<const N: usize>(&mut self) -> Result<[Self::Item; N], array::IntoIter<Self::Item, N>>
where
Self: Sized;
}
Steps / History
Unresolved Questions
- Naming: other options include
next_array() or next_array_chunk().
- How should we handle
N = 0?
View all comments
Feature gate:
#![feature(iter_next_chunk)]This is a tracking issue for the
.next_chunk()and.next_chunk_back()method on iterators which allows you to advance the iteratorNelements and return an array[T; N]Public API
Steps / History
Iterator::next_chunk#93700slice_iter.copied().next_chunk()#103166DoubleEndedIterator::next_chunk_back#156737Unresolved Questions
next_array()ornext_array_chunk().N = 0?