/// The representation of data, rows and columns of a [`Grid`]. /// /// [`Grid`]: crate::grid::iterable::Grid pub trait IntoRecords { /// A string representation of a [`Grid`] cell. /// /// [`Grid`]: crate::grid::iterable::Grid type Cell: AsRef; /// Cell iterator inside a row. type IterColumns: IntoIterator; /// Rows iterator. type IterRows: IntoIterator; /// Returns an iterator over rows. fn iter_rows(self) -> Self::IterRows; } impl IntoRecords for T where T: IntoIterator, ::Item: IntoIterator, <::Item as IntoIterator>::Item: AsRef, { type Cell = <::Item as IntoIterator>::Item; type IterColumns = ::Item; type IterRows = ::IntoIter; fn iter_rows(self) -> Self::IterRows { self.into_iter() } }