pub fn row_iter(&self, row_index: usize) -> Result<impl DoubleEndedIterator<Item = &T>, Error> {
        let start = self
            .get_index(row_index, 0)
            .ok_or(Error::IndicesOutOfBounds(row_index, 0))?;
        let end = start + self.row_len();
        Ok(self.array[start..end].iter())
    }
/// Returns an [`Iterator`] over references to all elements in the given
/// row. Returns an error if the index is out of bounds.
///
/// # Examples
///
/// ```
/// # use array2d::{Array2D, Error};
/// # fn main() -> Result<(), Error> {
/// let rows = vec![vec![1, 2, 3], vec![4, 5, 6]];
/// let array = Array2D::from_rows(&rows)?;
/// let mut row_iter = array.row_iter(1)?;
/// assert_eq!(row_iter.next(), Some(&4));
/// assert_eq!(row_iter.next(), Some(&5));
/// assert_eq!(row_iter.next(), Some(&6));
/// assert_eq!(row_iter.next(), None);
/// # Ok(())
/// # }
/// ```
///
/// [`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html
Returns an [`Iterator`] over references to all elements in the given
row. Returns an error if the index is out of bounds.
Returns an [ ` Iterator ` ] over references to all elements in the given row . Returns an error if the index is out of bounds .
pub fn row_iter(&self, row_index: usize) -> Result<impl DoubleEndedIterator<Item = &T>, Error> {
        let start = self
            .get_index(row_index, 0)
            .ok_or(Error::IndicesOutOfBounds(row_index, 0))?;
        let end = start + self.row_len();
        Ok(self.array[start..end].iter())
    }
pub fn row_iter ( & self , row_index : usize ) -> Result < impl DoubleEndedIterator < Item = & T > , Error > { let start = self . get_index ( row_index , 0 ) . ok_or ( Error :: IndicesOutOfBounds ( row_index , 0 ) ) ? ; let end = start + self . row_len ( ) ; Ok ( self . array [ start .. end ] . iter ( ) ) }
Returns an [`Iterator`] over references to all elements in the given
row.
Returns an [ ` Iterator ` ] over references to all elements in the given row .
&self
row_index
usize
&self
row_index
usize
examples
None
use array2d::{array2d, error};
None
fn main() -> result<(), error> {
None
ok(())
None
}
None