pub trait CellCollection: Collection {
// Required method
fn cell_info(&self, index: usize) -> Option<GridCellInfo>;
// Provided methods
fn iter_cell_info(
&self,
range: impl RangeBounds<usize>,
) -> CollectionIterCellInfo<'_, Self> { ... }
fn grid_dimensions(&self) -> GridDimensions { ... }
}
Expand description
A collection with attached cell info
Required Methods§
Sourcefn cell_info(&self, index: usize) -> Option<GridCellInfo>
fn cell_info(&self, index: usize) -> Option<GridCellInfo>
Get row/column info associated with cell at index
Provided Methods§
Sourcefn iter_cell_info(
&self,
range: impl RangeBounds<usize>,
) -> CollectionIterCellInfo<'_, Self>
fn iter_cell_info( &self, range: impl RangeBounds<usize>, ) -> CollectionIterCellInfo<'_, Self>
Iterate over GridCellInfo
of elements within range
Sourcefn grid_dimensions(&self) -> GridDimensions
fn grid_dimensions(&self) -> GridDimensions
Get or calculate grid dimension info
The default implementation calculates this from Self::cell_info
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.