pub struct CellIteration<'alloc, 's> { /* private fields */ }Expand description
Implementations§
Source§impl CellIteration<'_, '_>
impl CellIteration<'_, '_>
Sourcepub fn next(&mut self) -> Option<&Self>
pub fn next(&mut self) -> Option<&Self>
Move a cell iteration to the next cell.
Returns Some(cell) if the iteration moved successfully and cell
data is available to read at the new position using cell.
Sourcepub fn select(&mut self, x: u16) -> Result<()>
pub fn select(&mut self, x: u16) -> Result<()>
Move a cell iteration to a specific column.
Positions the iteration at the given x (column) index so that subsequent reads return data for that cell.
Sourcepub fn fg_color(&self) -> Result<Option<RgbColor>>
pub fn fg_color(&self) -> Result<Option<RgbColor>>
The resolved foreground color of the cell.
Resolves palette indices through the palette. Bold color handling is not applied; the caller should handle bold styling separately.
Returns None if the cell has no explicit foreground color, in which
case the caller should use whatever default foreground color it want
(e.g. the terminal foreground).
Sourcepub fn bg_color(&self) -> Result<Option<RgbColor>>
pub fn bg_color(&self) -> Result<Option<RgbColor>>
The resolved background color of the cell.
Flattens the three possible sources: Cell::bg_color_rgb,
Cell::bg_color_palette (looked up in the palette), or the
style’s bg_color.
Returns None if the cell has no background color, in which case the
caller should use whatever default background color it wants
(e.g. the terminal background).
Sourcepub fn graphemes(&self) -> Result<Vec<char>>
pub fn graphemes(&self) -> Result<Vec<char>>
Get the grapheme codepoints.
The base codepoint is placed first, followed by any extra codepoints.
Sourcepub fn graphemes_len(&self) -> Result<usize>
pub fn graphemes_len(&self) -> Result<usize>
The total number of grapheme codepoints including the base codepoint.
Returns 0 if the cell has no text.
Sourcepub fn graphemes_buf(&self, buf: &mut [char]) -> Result<()>
pub fn graphemes_buf(&self, buf: &mut [char]) -> Result<()>
Write grapheme codepoints into a caller-provided buffer.
The buffer must be at least CellIteration::graphemes_len elements.
The base codepoint is written first, followed by any extra codepoints.