#[non_exhaustive]pub struct DrawCell<'a> {
pub layer: u8,
pub pos: Pos,
pub tile: &'a Tile,
pub grapheme: Option<&'a str>,
pub tint: Tint,
}Expand description
One cell handed to a backend at draw time: the tile, plus the state that does not fit in one.
Tile is deliberately compact (20 bytes, no padding to spare), so a cell’s rarer members
live in a sparse side table on Grid instead. A backend cannot reach
that table, so they are delivered here.
This is a struct rather than a tuple because it has grown twice and will grow again. Each
addition would otherwise break every backend’s draw signature and leave the meaning of a
fourth or fifth unnamed element to the reader.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.layer: u8Which layer this cell belongs to. Always 0 for cells arriving through
Output::draw.
pos: PosWhere the cell sits in the grid.
tile: &'a TileThe tile itself.
grapheme: Option<&'a str>The tile’s full grapheme cluster, or None to render Tile::glyph alone.
Some only for multi-codepoint clusters (combining marks, ZWJ sequences), and only
ever Some when the egc feature is enabled: without it Grid never populates the
side table, so a backend that does not support egc can ignore this entirely and render
from Tile::glyph.
tint: TintHow a pixel backend recolours this cell’s sprite.
Tint::None for the overwhelming majority of cells. Cell backends have no sprite to
recolour and ignore it; see Tint.