pub struct CellDynamic { /* private fields */ }Expand description
Dynamic instance data for terminal cell appearance.
CellDynamic contains the frequently-changing visual data for each terminal
cell, including the character glyph and colors.
§Memory Layout
The 8-byte data array is packed as follows:
- Bytes 0-1: Glyph depth/layer index (u16, little-endian)
- Bytes 2-4: Foreground color RGB (3 bytes)
- Bytes 5-7: Background color RGB (3 bytes)
Implementations§
Source§impl CellDynamic
impl CellDynamic
pub fn new(glyph_id: u16, fg: u32, bg: u32) -> Self
Sourcepub fn style(&mut self, style_bits: u16)
pub fn style(&mut self, style_bits: u16)
Overwrites the current cell style bits with the provided style bits.
Sourcepub fn flip_colors(&mut self)
pub fn flip_colors(&mut self)
Swaps foreground and background colors.
Sourcepub fn get_fg_color(&self) -> u32
pub fn get_fg_color(&self) -> u32
Returns foreground color as a packed RGB value.
Sourcepub fn get_bg_color(&self) -> u32
pub fn get_bg_color(&self) -> u32
Returns background color as a packed RGB value.
Trait Implementations§
Source§impl Clone for CellDynamic
impl Clone for CellDynamic
Source§fn clone(&self) -> CellDynamic
fn clone(&self) -> CellDynamic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CellDynamic
impl Debug for CellDynamic
Source§impl Hash for CellDynamic
impl Hash for CellDynamic
impl Copy for CellDynamic
Auto Trait Implementations§
impl Freeze for CellDynamic
impl RefUnwindSafe for CellDynamic
impl Send for CellDynamic
impl Sync for CellDynamic
impl Unpin for CellDynamic
impl UnsafeUnpin for CellDynamic
impl UnwindSafe for CellDynamic
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