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

pub struct Cell { /* 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]

[src]

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

[src]

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

[src]

Set text alignment in the cell

[src]

Add a style attribute to the cell

[src]

Add a style attribute to the cell. Can be chained

[src]

Remove all style attributes and reset alignment to default (LEFT)

[src]

Set the cell's style by applying the given specifier string

Style spec syntax

The syntax for the style specifier looks like this : FrBybl which means Foreground red Background yellow bold left

List of supported specifiers :

  • F : Foreground (must be followed by a color specifier)
  • B : Background (must be followed by a color specifier)
  • b : bold
  • i : italic
  • u : underline
  • c : Align center
  • l : Align left
  • r : Align right
  • d : default style

List of color specifiers :

  • r : Red
  • b : Blue
  • g : Green
  • y : Yellow
  • c : Cyan
  • m : Magenta
  • w : White
  • d : Black

And capital letters are for bright colors. Eg :

  • R : Bright Red
  • B : Bright Blue
  • ... and so on ...

[src]

Return the height of the cell

[src]

Return the width of the cell

[src]

Return a copy of the full string contained in the cell

[src]

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

[src]

Apply style then call print to print the cell into a terminal

Trait Implementations

impl Clone for Cell
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Cell
[src]

[src]

Formats the value using the given formatter. Read more

impl Hash for Cell
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Cell
[src]

[src]

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

[src]

This method tests for !=.

impl Eq for Cell
[src]

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

[src]

Performs the conversion.

impl ToString for Cell
[src]

[src]

Converts the given value to a String. Read more

impl Default for Cell
[src]

[src]

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

Auto Trait Implementations

impl Send for Cell

impl Sync for Cell