Struct CellData

Source
pub struct CellData<'a> { /* private fields */ }
Expand description

Data for a single terminal cell including character and colors.

CellData represents the visual content of one terminal cell, including the character to display and its foreground and background colors. Colors are specified as RGB values packed into 32-bit integers.

§Color Format

Colors use the format 0xRRGGBB where:

  • RR: Red component
  • GG: Green component
  • BB: Blue component

Implementations§

Source§

impl<'a> CellData<'a>

Source

pub fn new( symbol: &'a str, style: FontStyle, effect: GlyphEffect, fg: u32, bg: u32, ) -> Self

Creates new cell data with the specified character and colors.

§Parameters
  • symbol - Character to display (should be a single character)
  • style - Font style for the character (e.g. bold, italic)
  • effect - Optional glyph effect (e.g. underline, strikethrough)
  • fg - Foreground color as RGB value (0xRRGGBB)
  • bg - Background color as RGB value (0xRRGGBB)
§Returns

New CellData instance

Source

pub fn new_with_style_bits( symbol: &'a str, style_bits: u16, fg: u32, bg: u32, ) -> Self

Creates new cell data with pre-encoded style bits.

This is a lower-level constructor that accepts pre-encoded style bits rather than separate FontStyle and GlyphEffect parameters. Use this when you have already combined the style flags or when working directly with the bit representation.

§Parameters
  • symbol - Character to display
  • style_bits - Pre-encoded style flags. Must not overlap with base glyph ID bits (0x01FF). Valid bits include:
    • 0x0200 - Bold
    • 0x0400 - Italic
    • 0x0800 - Emoji (set automatically by the renderer for emoji glyphs)
    • 0x1000 - Underline
    • 0x2000 - Strikethrough
  • fg - Foreground color as RGB value (0xRRGGBB)
  • bg - Background color as RGB value (0xRRGGBB)
§Returns

New CellData instance

§Panics

Debug builds will panic if style_bits contains any invalid bits.

Trait Implementations§

Source§

impl<'a> Debug for CellData<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CellData<'a>

§

impl<'a> RefUnwindSafe for CellData<'a>

§

impl<'a> Send for CellData<'a>

§

impl<'a> Sync for CellData<'a>

§

impl<'a> Unpin for CellData<'a>

§

impl<'a> UnwindSafe for CellData<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.