Trait CellCollection

Source
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§

Source

fn cell_info(&self, index: usize) -> Option<GridCellInfo>

Get row/column info associated with cell at index

Provided Methods§

Source

fn iter_cell_info( &self, range: impl RangeBounds<usize>, ) -> CollectionIterCellInfo<'_, Self>

Iterate over GridCellInfo of elements within range

Source

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.

Implementors§

Source§

impl<W, C> CellCollection for C
where W: Widget, C: Collection + Deref<Target = [(GridCellInfo, W)]>,