Module gridly::grid

source ·
Expand description

Core grid traits.

This module contains the core grid traits that power gridly grids. These traits (in combination with Vector and Location) provide all of gridly’s central reading, writing, and bounds-checking functionality.

Structs

Enums

  • An out-of-bounds error for a Location on a grid

Traits

  • Base Reader trait for grids. This trait provides the grid’s cell type, Item, and an unsafe getter method for fetching a cell at a bounds-checked location. It uses this unsafe getter, plus GridBounds based bounds-checking, to provide a comprehensive and safe interface for reading and iterating over elements in a grid.
  • Grid trait implementing grid sizes and boundary checking.
  • Setter trait for grids. Allows setting and replacing elements in the grid. Implementors should implement the unsafe setter and replacer methods. This trait then provides implementations of safe, bounds-checked setters.

Type Aliases