Expand description
Provides iterators over CellMaps.
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
Indexedwrapper type which modifies aSlicerto produce the current index as well as the value. - layerers
- Provides layerer types which are used in combination with
Slicertypes to determine the order and form in which data is produced from the layers within aCellMap. - positioned
- Provides the
Positionedwrapper type which modifies aSlicerto produce the current position as well as the value. - slicers
- Provides the
Slicertrait and slicers types that determine the order and pattern in which data is produced by an interator over aCellMap.
Structs§
- Cell
MapIter - A non-mutable iterator over a
CellMap, seeSlicerandlayerersfor more information. - Cell
MapIter Mut - A mutable iterator over a
CellMap, seeSlicerandlayerersfor more information.