Struct comfy_table::Cell

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

A stylable table cell with content.

Implementations§

Create a new Cell

Return a copy of the content contained in this cell.

Set the delimiter used to split text for this cell.
Normal text uses spaces ( ) as delimiters. This is necessary to help comfy-table understand the concept of words.

Set the alignment of content for this cell.

Setting this overwrites alignment settings of the Column for this specific cell.

use comfy_table::CellAlignment;
use comfy_table::Cell;

let mut cell = Cell::new("Some content")
    .set_alignment(CellAlignment::Center);

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

Convert anything with ToString to a new Cell.

let cell: Cell = "content".into();
let cell: Cell = 5u32.into();
Converts to this type from the input type.

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
Converts to this type from the input type.

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.