CoordsIterator

Trait CoordsIterator 

Source
pub trait CoordsIterator: Iterator + Sealed {
    // Provided method
    fn coords(self) -> WithCoordsIter<Self> 
       where Self: Sized { ... }
}
Expand description

Provides an interface for iterators that can also yield 2D coordinates.

Note that this trait is sealed, meaning it cannot be implemented by downstream crates. This pattern is as described here.

Provided Methods§

Source

fn coords(self) -> WithCoordsIter<Self>
where Self: Sized,

Returns an iterator adapter that also gives coordinates as well as the next value.

The iterator returned yields 2-tuples (coords, elem), where coords is the coordinates of the next element elem. This is essentially a 2D version of Iterator::enumerate.

Implementors§

Source§

impl<T, B: BlockDim> CoordsIterator for BlockIter<'_, T, B>

Source§

impl<T, B: BlockDim> CoordsIterator for BlockIterMut<'_, T, B>

Source§

impl<T, B: BlockDim> CoordsIterator for EachIter<'_, T, B>

Source§

impl<T, B: BlockDim> CoordsIterator for EachIterMut<'_, T, B>

Source§

impl<T, B: BlockDim> CoordsIterator for RowMajorIter<'_, T, B>

Source§

impl<T, B: BlockDim> CoordsIterator for RowMajorIterMut<'_, T, B>