pub struct Cell {
pub grapheme: String,
pub style: Style,
pub width: u8,
}Expand description
A single cell in the terminal screen buffer.
Fields§
§grapheme: StringThe grapheme cluster displayed in this cell.
style: StyleThe style of this cell.
width: u8Display width (1 for most chars, 2 for CJK/emoji, 0 for continuation).
Implementations§
Source§impl Cell
impl Cell
Sourcepub fn new(grapheme: impl Into<String>, style: Style) -> Self
pub fn new(grapheme: impl Into<String>, style: Style) -> Self
Create a new cell, auto-detecting width from the grapheme.
Sourcepub fn is_blank(&self) -> bool
pub fn is_blank(&self) -> bool
Returns true if this is a blank cell (space with default style).
Sourcepub fn is_continuation(&self) -> bool
pub fn is_continuation(&self) -> bool
Returns true if this is a continuation cell (width == 0).
Continuation cells occupy the second column of a wide character.
Sourcepub fn continuation() -> Self
pub fn continuation() -> Self
Create a continuation cell (placeholder for the second cell of a wide character).
Trait Implementations§
impl Eq for Cell
impl StructuralPartialEq for Cell
Auto Trait Implementations§
impl Freeze for Cell
impl RefUnwindSafe for Cell
impl Send for Cell
impl Sync for Cell
impl Unpin for Cell
impl UnwindSafe for Cell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more