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.
Sourcepub fn graphemes_utf8(&self, buf: &mut String) -> Result<()>
pub fn graphemes_utf8(&self, buf: &mut String) -> Result<()>
Encode the current cell’s full grapheme cluster as UTF-8 into a caller-provided string buffer.
The base codepoint is encoded first, followed by any extra grapheme codepoints.
May grow the buffer if more space is required.
Sourcepub fn is_selected(&self) -> Result<bool>
pub fn is_selected(&self) -> Result<bool>
Whether the cell is contained within the current selection.
This returns true when the cell’s column is within the current row’s row-local selection range, and false otherwise. Rendering policy for selected cells (colors, inversion, etc.) is left to the caller.
Renderers that can draw cells in spans may be more efficient calling
RowIteration::selection once per row and applying that range
directly, avoiding one C API call per cell for selection state.
Sourcepub fn has_styling(&self) -> Result<bool>
pub fn has_styling(&self) -> Result<bool>
Whether the cell has any explicit styling.
This is equivalent to querying the raw cell’s Cell::has_styling
value, but avoids materializing the raw Cell for renderers that
only need to know whether fetching the full style is necessary.