pub fn from_iter_column_major<I>(
        iterator: I,
        num_rows: usize,
        num_columns: usize,
    ) -> Result<Self, Error>
    where
        I: Iterator<Item = T>,
        T: Clone,
    {
        let total_len = num_rows * num_columns;
        let array_column_major = iterator.take(total_len).collect::<Vec<_>>();
        #[allow(clippy::map_err_ignore)]
        Array2D::from_column_major(&array_column_major, num_rows, num_columns)
            .map_err(|_| Error::NotEnoughElements)
    }
/// Creates a new [`Array2D`] with the specified number of rows and columns
/// and fills each element with the elements produced from the provided
/// iterator. If the iterator produces more than enough elements, the
/// remaining are unused. Returns an error if the iterator does not produce
/// enough elements.
///
/// The elements are inserted into the array in [column major order].
///
/// # Examples
///
/// ```
/// # use array2d::{Array2D, Error};
/// # fn main() -> Result<(), Error> {
/// let iterator = (1..);
/// let array = Array2D::from_iter_column_major(iterator, 2, 3)?;
/// assert_eq!(array.as_rows(), vec![vec![1, 3, 5], vec![2, 4, 6]]);
/// # Ok(())
/// # }
/// ```
///
/// [`Array2D`]: struct.Array2D.html
/// [column major order]: https://en.wikipedia.org/wiki/Row-_and_column-major_order
Creates a new [`Array2D`] with the specified number of rows and columns
and fills each element with the elements produced from the provided
iterator. If the iterator produces more than enough elements, the
remaining are unused. Returns an error if the iterator does not produce
enough elements.

The elements are inserted into the array in [column major order].
Creates a new [ ` Array2D ` ] with the specified number of rows and columns and fills each element with the elements produced from the provided iterator . If the iterator produces more than enough elements the remaining are unused . Returns an error if the iterator does not produce enough elements . The elements are inserted into the array in [ column major order ] .
pub fn from_iter_column_major<I>(
        iterator: I,
        num_rows: usize,
        num_columns: usize,
    ) -> Result<Self, Error>
    where
        I: Iterator<Item = T>,
        T: Clone,
    {
        let total_len = num_rows * num_columns;
        let array_column_major = iterator.take(total_len).collect::<Vec<_>>();
        #[allow(clippy::map_err_ignore)]
        Array2D::from_column_major(&array_column_major, num_rows, num_columns)
            .map_err(|_| Error::NotEnoughElements)
    }
pub fn from_iter_column_major < I > ( iterator : I , num_rows : usize , num_columns : usize , ) -> Result < Self , Error > where I : Iterator < Item = T > , T : Clone , { let total_len = num_rows * num_columns ; let array_column_major = iterator . take ( total_len ) . collect :: < Vec < _ > > ( ) ; # [ allow ( clippy map_err_ignore ) ] Array2D :: from_column_major ( & array_column_major , num_rows , num_columns ) . map_err ( | _ | Error :: NotEnoughElements ) }
Creates a new [`Array2D`] with the specified number of rows and columns
and fills each element with the elements produced from the provided
iterator.
Creates a new [ ` Array2D ` ] with the specified number of rows and columns and fills each element with the elements produced from the provided iterator .
iterator
I
num_rows
usize
num_columns
usize
iterator
I
num_rows
usize
num_columns
usize
examples
None
use array2d::{array2d, error};
None
fn main() -> result<(), error> {
None
ok(())
None
}
None