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§
Sourcefn coords(self) -> WithCoordsIter<Self> ⓘwhere
Self: Sized,
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.