Struct prettytable::cell::Cell [] [src]

pub struct Cell {
    // some fields omitted
}

Represent a table cell containing a string.

Once created, a cell's content cannot be modified. The cell would have to be replaced by another one

Methods

impl Cell
[src]

fn new_align(string: &str, align: Align) -> Cell

Create a new Cell initialized with content from string. Text alignment in cell is configurable with the align argument

fn new(string: &str) -> Cell

Create a new Cell initialized with content from string. By default, content is align to LEFT

fn align(&mut self, align: Align)

Set text alignment in the cell

fn get_height(&self) -> usize

Return the height of the cell

fn get_width(&self) -> usize

Return the width of the cell

fn get_content(&self) -> String

Return a copy of the full string contained in the cell

fn print<T: Write>(&self, out: &mut T, idx: usize, col_width: usize) -> Result<()Error>

Print a partial cell to out. Since the cell may be multi-lined, idx is the line index to print. col_width is the column width used to fill the cells with blanks so it fits in the table. If ìdx is higher than this cell's height, it will print empty content

Trait Implementations

impl Debug for Cell
[src]

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

Formats the value using the given formatter.

impl Clone for Cell
[src]

fn clone(&self) -> Cell

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<'a, T: ToString> From<&'a T> for Cell
[src]

fn from(f: &T) -> Cell

Performs the conversion.

impl ToString for Cell
[src]

fn to_string(&self) -> String

Converts the given value to a String. Read more

impl Default for Cell
[src]

fn default() -> Cell

Return a cell initialized with a single empty String, with LEFT alignment