ArrayConsumer

Struct ArrayConsumer 

Source
#[doc(hidden)] pub struct ArrayConsumer<T, N: ArrayLength<T>> { /* private fields */ }
Expand description

Consumes an array.

Increment the position while iterating and any leftover elements will be dropped if position does not go to N

Implementations§

Source§

impl<T, N: ArrayLength<T>> ArrayConsumer<T, N>

Source

#[doc(hidden)] pub unsafe fn new( array: GenericArray<T, N>, ) -> ArrayConsumer<T, N>

Source

#[doc(hidden)] pub unsafe fn iter_position( &mut self, ) -> (Iter<'_, T>, &mut usize)

Creates an iterator and mutable reference to the internal position to keep track of consumed elements.

Increment the position as you iterate to mark off consumed elements

Trait Implementations§

Source§

impl<T, N: ArrayLength<T>> Drop for ArrayConsumer<T, N>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more