pub struct Cell {
pub codepoint: u32,
pub fg: u32,
pub bg: u32,
pub flags: u16,
/* private fields */
}Expand description
One renderable cell. Exactly 16 bytes: codepoint (4) + fg (4) + bg (4) + flags (2) + padding (2). 4 cells per 64-byte cache line, which makes row walks cache-friendly.
Construction is direct (Cell { codepoint, fg, bg, flags, .. })
or via the [Cell::blank] / Cell::with_codepoint
constructors below.
Fields§
§codepoint: u32Unicode scalar value. 0 is the empty/blank cell sentinel.
fg: u320xRRGGBB. Theme-resolved foreground colour.
bg: u320xRRGGBB. Theme-resolved background colour; 0 is
“transparent” → renderer uses the pane background.
flags: u16Bit flags from flags.
Implementations§
Source§impl Cell
impl Cell
Sourcepub const BLANK: Self
pub const BLANK: Self
All-zero cell: blank codepoint, transparent fg/bg, no flags. The default value for unused trailing cells in a shorter-than-row source line.
Sourcepub const fn with_codepoint(codepoint: u32) -> Self
pub const fn with_codepoint(codepoint: u32) -> Self
Construct a default-coloured cell at codepoint. fg/bg
default to 0 (renderer fills from theme); call sites that
know colours should construct the struct literal directly.
Sourcepub const fn new(codepoint: u32, fg: u32, bg: u32, flags: u16) -> Self
pub const fn new(codepoint: u32, fg: u32, bg: u32, flags: u16) -> Self
Convenience builder used in tests + cell-builder fixtures. Direct struct construction is the normal path.
Sourcepub fn is_blank(&self) -> bool
pub fn is_blank(&self) -> bool
true when the cell has the blank-sentinel codepoint. Does
not consider fg/bg/flags — a blank-codepoint cell with a
non-zero bg is still considered blank for content purposes
(it’s used for trailing-cell padding within a row).
Sourcepub fn is_ws_marker(&self) -> bool
pub fn is_ws_marker(&self) -> bool
true when this cell is a whitespace marker glyph.
Sourcepub fn is_underline(&self) -> bool
pub fn is_underline(&self) -> bool
S3.a: true iff the underline modifier bit is set.
Sourcepub fn is_reverse(&self) -> bool
pub fn is_reverse(&self) -> bool
S3.a: true iff the reverse modifier bit is set.