Struct term_grid::Cell [] [src]

pub struct Cell {
    pub contents: String,
    pub width: Width,
}

A Cell is the combination of a string and its pre-computed length.

The easiest way to create a Cell is just by using string.into(), which uses the unicode width of the string (see the unicode_width crate). However, the fields are public, if you wish to provide your own length.

Fields

contents: String

The string to display when this cell gets rendered.

width: Width

The pre-computed length of the string.

Trait Implementations

impl Debug for Cell
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for Cell
[src]

fn eq(&self, __arg_0: &Cell) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Cell) -> bool

This method tests for !=.

impl From<String> for Cell
[src]

fn from(string: String) -> Self

Performs the conversion.

impl<'_> From<&'_ str> for Cell
[src]

fn from(string: &'_ str) -> Self

Performs the conversion.