pub struct Cell {
pub ch: char,
pub style: Style,
pub width: CellWidth,
}Expand description
One character cell: a char, its Style, and its CellWidth. The
default cell is a single-width space in the default style.
A double-width glyph is a Cell::wide lead followed by a
Cell::continuation; build cells with the constructors to keep that
pairing. A grid can still hold an unpaired half (a compositor clipping a
row through a glyph produces one), so readers of arbitrary cells should
expect it.
Fields§
§ch: char§style: Style§width: CellWidthImplementations§
Source§impl Cell
impl Cell
Sourcepub const fn wide(ch: char, style: Style) -> Self
pub const fn wide(ch: char, style: Style) -> Self
The lead (left half) of a double-width glyph. Its right neighbor should
be a Cell::continuation.
Sourcepub const fn continuation(style: Style) -> Self
pub const fn continuation(style: Style) -> Self
A continuation (right half) of a double-width glyph: no character of its
own, but carrying style so the covered column keeps the right
background. Never emitted — the lead glyph fills both columns.
Trait Implementations§
impl Copy for Cell
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 UnsafeUnpin 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