Trait block_grid::iters::CoordsIterator [−][src]
pub trait CoordsIterator: Iterator + Sealed {
fn coords(self) -> WithCoordsIter<Self>ⓘNotable traits for WithCoordsIter<I>impl<I: CoordsIterator> Iterator for WithCoordsIter<I> type Item = (Coords, I::Item);
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
fn coords(self) -> WithCoordsIter<Self>ⓘNotable traits for WithCoordsIter<I>impl<I: CoordsIterator> Iterator for WithCoordsIter<I> type Item = (Coords, I::Item);
where
Self: Sized,
fn coords(self) -> WithCoordsIter<Self>ⓘNotable traits for WithCoordsIter<I>impl<I: CoordsIterator> Iterator for WithCoordsIter<I> type Item = (Coords, I::Item);
where
Self: Sized,
Notable traits for WithCoordsIter<I>
impl<I: CoordsIterator> Iterator for WithCoordsIter<I> type Item = (Coords, I::Item);
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
.