Struct libtableformat::table::cell::Cell [−][src]
pub struct Cell { /* fields omitted */ }
A table cell represents a single grid rectangle within a table.
Cells belong to a row.
Implementations
impl Cell
[src]
impl Cell
[src]#[must_use]pub fn empty() -> Cell
[src]
#[must_use]
pub fn empty() -> Cell#[must_use]pub fn new(contents: Vec<Content>, base_style: ContentStyle) -> Cell
[src]
#[must_use]
pub fn new(contents: Vec<Content>, base_style: ContentStyle) -> Cell#[must_use]pub fn from_styled_content(format: &str, contents: Vec<&str>) -> Cell
[src]
#[must_use]pub fn from_styled_content(format: &str, contents: Vec<&str>) -> Cell
[src]Returns a Cell
from styled content.
Arguments
format
- The style format.contents
- The contents of the new cell.
#[must_use]pub fn from_data_item(data_item: &DataItem, base_style: ContentStyle) -> Cell
[src]
#[must_use]pub fn from_data_item(data_item: &DataItem, base_style: ContentStyle) -> Cell
[src]Returns a Cell
from a DataItem
.
Arguments
data_item
- The data item from which to build the table cell.base_style
- The base style to apply to the cell contents.
#[must_use]pub fn get_cell_width(self: &Cell) -> CellWidth
[src]
#[must_use]pub fn get_cell_width(self: &Cell) -> CellWidth
[src]Returns the column break specified in the first content line of the cell.
This is used to determine the column break for cells used in the table header row.
#[must_use]pub fn get_iterator(
self: &Cell,
column_break: &CellWidth
) -> TableCellContentIterator<'_>ⓘNotable traits for TableCellContentIterator<'a>
impl<'a> Iterator for TableCellContentIterator<'a> type Item = String;
[src]
#[must_use]pub fn get_iterator(
self: &Cell,
column_break: &CellWidth
) -> TableCellContentIterator<'_>ⓘNotable traits for TableCellContentIterator<'a>
impl<'a> Iterator for TableCellContentIterator<'a> type Item = String;
[src]Returns the next formatted line of content from this table cell.
Arguments
self
- The table cell containing the line.width
- The format width.
#[must_use]pub fn measure_height(self: &Cell, column_break: &CellWidth) -> usize
[src]
#[must_use]pub fn measure_height(self: &Cell, column_break: &CellWidth) -> usize
[src]Measures the height needed for this cell when formatting its contents into a specific column width.
Arguments
self
- The table cell being measured.column_width
- The column width to measure against.
#[must_use]pub fn measure_width(self: &Cell, column_break: &CellWidth) -> usize
[src]
#[must_use]pub fn measure_width(self: &Cell, column_break: &CellWidth) -> usize
[src]Measures the width of this cell.
Arguments
self
- The table cell being measured.column_break
- The column break for this cell.