Function from_iter

Source
pub fn from_iter<I, T, const N: usize>(
    iter: I,
) -> Result<[T; N], IntoIter<T, N>>
where I: Iterator<Item = T>,
Expand description

Consumes N elements from the iterator and returns them as an array. If the iterator yields fewer than N items, Err is returned containing the already yielded items.

ยงPanics

If the iterator panics then all already yielded elements will be dropped.