Struct titik::Cell[][src]

pub struct Cell {
    pub symbol: String,
    pub foreground_color: Option<Color>,
    pub background_color: Option<Color>,
    pub attributes: Attributes,
}

Cell contains the attributes of the char used in the buffer. This information is needed when rendering each cell to the terminal

Fields

symbol: String

the character symbol

foreground_color: Option<Color>

The foreground color.

background_color: Option<Color>

The background color.

attributes: Attributes

List of attributes.

Implementations

impl Cell[src]

pub fn new<S>(symbol: S) -> Self where
    S: ToString
[src]

create a new Cell from character or string

pub fn unicode_width(&self) -> usize[src]

returns the unicode width of the cell. Some characters are wide such as CJK

pub fn empty() -> Self[src]

creates an empty Cell

pub fn bold(&mut self)[src]

render this cell as bold

pub fn is_blank(&self) -> bool[src]

whether or not this cell is blank

pub fn is_filler(&self) -> bool[src]

whether or not this cell is a filler of a wide character that appears before it

pub fn attributes(&mut self, attributes: Vec<Attribute>)[src]

return the attributes of this cell

pub fn color(&mut self, color: Color)[src]

set the foreground color of this cell

pub fn background(&mut self, color: Color)[src]

set the background color of this cell

Trait Implementations

impl Clone for Cell[src]

impl Debug for Cell[src]

impl Default for Cell[src]

impl Display for Cell[src]

impl PartialEq<Cell> for Cell[src]

impl StructuralPartialEq for Cell[src]

Auto Trait Implementations

impl RefUnwindSafe for Cell

impl Send for Cell

impl Sync for Cell

impl Unpin for Cell

impl UnwindSafe for Cell

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.