[−][src]Trait gridly::grid::Grid
View methods for a Grid, aimed at providing support for iterating over rows, columns, and cells inside of those views.
Provided methods
fn get(
&self,
location: impl Into<Location>
) -> Result<&Self::Item, LocationRangeError>
&self,
location: impl Into<Location>
) -> Result<&Self::Item, LocationRangeError>
Get a reference to a cell in a grid. Returns an error if the location is out of bounds with the specific boundary violation.
fn view<T: LocComponent>(&self) -> View<Self, T>
fn rows(&self) -> RowsView<Self>
Get a view of a grid's rows
fn columns(&self) -> ColumnsView<Self>
Get a view of a grid's columns
unsafe fn single_view_unchecked<T: LocComponent>(
&self,
index: T
) -> SingleView<Self, T>
&self,
index: T
) -> SingleView<Self, T>
Get a view of a single row or column in a grid, without bounds checking that row or column index.
unsafe fn row_unchecked(&self, row: impl Into<Row>) -> RowView<Self>
Get a view of a single row in a grid, without bounds checking that row's index
unsafe fn column_unchecked(&self, column: impl Into<Column>) -> ColumnView<Self>
Get a view of a single column in a grid, without bounds checking that column's index
fn single_view<T: LocComponent>(
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>>
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>>
Get a view of a single row or column in a grid. Returns an error if the index of the row or column is out of bounds for the grid.
fn row(&self, row: impl Into<Row>) -> Result<RowView<Self>, RowRangeError>
Get a view of a single row in a grid. Returns an error if the index of the row is out of bounds for the grid.
fn column(
&self,
column: impl Into<Column>
) -> Result<ColumnView<Self>, ColumnRangeError>
&self,
column: impl Into<Column>
) -> Result<ColumnView<Self>, ColumnRangeError>
Get a view of a single column in a grid. Returns an error if the index of the column is out of bounds for the grid.
Implementors
impl<G: BaseGrid> Grid for G
[src]
fn get(
&self,
location: impl Into<Location>
) -> Result<&Self::Item, LocationRangeError>
[src]
&self,
location: impl Into<Location>
) -> Result<&Self::Item, LocationRangeError>
fn view<T: LocComponent>(&self) -> View<Self, T>
[src]
fn rows(&self) -> RowsView<Self>
[src]
fn columns(&self) -> ColumnsView<Self>
[src]
unsafe fn single_view_unchecked<T: LocComponent>(
&self,
index: T
) -> SingleView<Self, T>
[src]
&self,
index: T
) -> SingleView<Self, T>
unsafe fn row_unchecked(&self, row: impl Into<Row>) -> RowView<Self>
[src]
unsafe fn column_unchecked(&self, column: impl Into<Column>) -> ColumnView<Self>
[src]
fn single_view<T: LocComponent>(
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>>
[src]
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>>
fn row(&self, row: impl Into<Row>) -> Result<RowView<Self>, RowRangeError>
[src]
fn column(
&self,
column: impl Into<Column>
) -> Result<ColumnView<Self>, ColumnRangeError>
[src]
&self,
column: impl Into<Column>
) -> Result<ColumnView<Self>, ColumnRangeError>