IntoChunkIterator

Trait IntoChunkIterator 

Source
pub trait IntoChunkIterator {
    type Item;
    type IterType: Iterator<Item = Self::Item>;

    // Required method
    fn into_chunk_iter(self, chunk_size: usize) -> Self::IterType;
}
Expand description

This trait generalizes the method chunks available on slices in the standard library. Collections that can be chunked by a runtime stride should implement this behaviour such that they can be composed with ChunkedN types.

Required Associated Types§

Source

type Item

Source

type IterType: Iterator<Item = Self::Item>

Required Methods§

Source

fn into_chunk_iter(self, chunk_size: usize) -> Self::IterType

Produce a chunk iterator with the given stride chunk_size. One notable difference between this trait and chunks* methods on slices is that chunks_iter should panic when the underlying data cannot split into chunk_size sized chunks exactly.

Implementors§