pub struct Cell {
pub symbol: CompactString,
pub style: Style,
pub hyperlink: Option<CompactString>,
}Expand description
A single terminal cell containing a character and style.
Each cell holds one grapheme cluster (stored as a CompactString for
inline storage of short strings — no heap allocation for ≤24 bytes).
Wide graphemes occupy adjacent cells. The leading cell stores the
grapheme and every continuation cell has an empty symbol.
Fields§
§symbol: CompactStringThe grapheme cluster displayed in this cell. Defaults to a single space.
style: StyleThe visual style (colors and modifiers) for this cell.
hyperlink: Option<CompactString>Optional OSC 8 hyperlink URL. When set, the terminal renders this cell as a clickable link.
Implementations§
Source§impl Cell
impl Cell
Sourcepub fn set_symbol(&mut self, s: &str) -> &mut Self
pub fn set_symbol(&mut self, s: &str) -> &mut Self
Replace the cell’s symbol with the given string slice.
Only the first extended grapheme cluster is retained. C0, DEL, and C1
controls are replaced with U+FFFD, and the optional hyperlink is
cleared so direct symbol replacement cannot inherit stale link state.
Sourcepub fn set_char(&mut self, ch: char) -> &mut Self
pub fn set_char(&mut self, ch: char) -> &mut Self
Replace the cell’s symbol with a single character.
Sourcepub fn is_continuation(&self) -> bool
pub fn is_continuation(&self) -> bool
Return whether this cell continues a grapheme stored in a prior cell.
Empty symbols are reserved as continuation metadata; ordinary blank cells contain a single space.