Module cell_map::iterators [−][src]
Expand description
Provides iterators over CellMap
s.
Iterators are constructed using the iter
family of functions on CellMap
, such as
CellMap::iter()
and CellMap::window_iter_mut()
. Which function you use determines
which Slicer
the iterator uses, in other words what order and shape the iterated items will
be produced in.
Once constructed both CellMapIter
and CellMapIterMut
provide functions to modify the
which layers are produced, and whether or not the items also produce their indexes. These can
be used like iterator combinators.
Examples
Iterate over a 3x3 window of items in the Height
layer, while also returning the indices
of the central cell of the window:
for ((layer, index), height) in map.window_iter(Vector2::new(1, 1)).unwrap().indexed() { println!("[{:?}, {}, {}] = {}", layer, index.x, index.y, height); }
Modules
indexed | Provides the |
layerers | Provides layerer types which are used in combination with |
slicers | Provides the |
Structs
CellMapIter | A non-mutable iterator over a |
CellMapIterMut | A mutable iterator over a |