Enum collect_array::CollectArrayResult [−][src]
pub enum CollectArrayResult<T, const N: usize> { Ok([T; N]), TooManyElements { values: [T; N], next_value: T, }, NotEnoughElements { values: [MaybeUninit<T>; N], init_count: usize, }, }
Expand description
The result of collecting an Iterator into an exactly-sized array, or having failed to.
More than N elements may be consumed from the Iterator - if this is undesirable, consider
calling Iterator
before collecting.
Variants
Returned if the Iterator contained exactly N elements.
Returned if the Iterator contained more than N elements. The underlying Iterator may not be exhausted, and remaining values may not be accessible.
Show fields
Returned if the Iterator contained fewer than N elements.
Safety
Only the first init_count
elements will be init, the remaining elements must not be read.
Show fields
Fields of NotEnoughElements
values: [MaybeUninit<T>; N]
The consumed values, only init_count
of which will be init.
init_count: usize
How many elements in values
are init.
Implementations
Trait Implementations
Creates a value from an iterator. Read more
impl<T, const N: usize> PartialEq<CollectArrayResult<T, N>> for CollectArrayResult<T, N> where
T: PartialEq,
[src]
impl<T, const N: usize> PartialEq<CollectArrayResult<T, N>> for CollectArrayResult<T, N> where
T: PartialEq,
[src]Auto Trait Implementations
impl<T, const N: usize> Send for CollectArrayResult<T, N> where
T: Send,
impl<T, const N: usize> Sync for CollectArrayResult<T, N> where
T: Sync,
impl<T, const N: usize> Unpin for CollectArrayResult<T, N> where
T: Unpin,