[−][src]Trait gridly::grid::GridBounds
High-level trait implementing grid sizes and boundary checking.
This trait doesn't provide any direct grid functionality, but instead provides the bounds checking which is generic to all of the different kinds of grid.
Note for implementors:
Required methods
fn dimensions(&self) -> Vector
Get the dimensions of the grid, as a Vector. This value MUST be
const for any given grid.
Provided methods
fn num_rows(&self) -> Rows
Get the height of the grid in Rows. This value MUST be const for
any given grid.
fn num_columns(&self) -> Columns
Get the width of the grid, in Columns. This value MUST be const for
any given grid.
fn root_row(&self) -> Row
Return the index of the topmost row of this grid. For most grids, this is 0, but some grids may include negatively indexed locations, or even offsets. This value MUST be const for any given grid.
fn root_column(&self) -> Column
Return the index of the leftmost column of this grid. For most grids, this is 0, but some grids may include negatively indexed locations, or even offsets. This value MUST be const for any given grid.
fn root(&self) -> Location
Return the root location (ie, the top left) of the grid. For most grids, this is (0, 0), but some grids may include negatively indexed locations, or even offsets. This value MUST be const for any given grid.