pub struct Cell { /* private fields */ }
Expand description

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

Implementations

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

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

Set text alignment in the cell

Add a style attribute to the cell

Add a style attribute to the cell. Can be chained

Add horizontal spanning to the cell

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

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)
  • H : Horizontal span (must be followed by a number)
  • 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 …

Set horizontal span for this cell (must be > 0)

Get horizontal span of this cell (> 0)

Return a copy of the full string contained in the cell

Print the cell in HTML format to out.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Converts to this type from the input type.

Feeds this value into the given Hasher. Read more

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

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

This method tests for !=.

Converts the given value to a String. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.