Trait array_iter_tools::ArrayIterator[][src]

pub trait ArrayIterator<const N: usize>: Sized {
    type Item;
    fn get(&self, n: usize) -> Self::Item;

    fn map_array<U, F: Fn(Self::Item) -> U>(self, f: F) -> Map<Self, F> { ... }
fn zip_array<B: ArrayIterator<N>>(self, b: B) -> Zip<Self, B> { ... }
fn collect_array(self) -> [Self::Item; N]
    where
        Self::Item: Copy
, { ... }
fn build_array(self) -> [Self::Item; N]
    where
        Self::Item: Drop
, { ... } }
Expand description

Similar to Iterator, ArrayIterator is an iterator over constant sized arrays

Associated Types

Item returned by this ArrayIterator

Required methods

Get a single item out of this ArrayIterator

Panics: This is expected to panic if n >= N

Provided methods

Lazily mutate the contents of an array

Lazily combine two ArrayIterators into an new one

Collect the contents of this ArrayIterator into an array

This is very similar to build_array but ignores the case that any drop handlers need to be called

Build the contents of this ArrayIterator into an array

This is very similar to collect_array but explicitly handles the case where the function panics and items need to be dropped

Implementations on Foreign Types

Implementors