Struct libtableformat::table::table_cell::TableCell[][src]

pub struct TableCell { /* fields omitted */ }

A table cell represents a single grid rectangle within a table.

Cells belong to a row.

Implementations

impl TableCell[src]

pub fn empty() -> TableCell[src]

pub fn new(contents: Vec<Content>, base_style: ContentStyle) -> TableCell[src]

pub fn from_styled_content(format: &str, contents: Vec<&str>) -> TableCell[src]

pub fn from_data_item(
    data_item: &DataItem,
    base_style: ContentStyle
) -> TableCell
[src]

Returns a TableCell 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.

pub fn get_break_from_content(self: &TableCell) -> ColumnBreak[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.

pub fn get_iterator(
    self: &TableCell,
    column_break: &ColumnBreak
) -> 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.

pub fn measure_height(self: &TableCell, column_break: &ColumnBreak) -> 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.

pub fn measure_width(self: &TableCell, column_break: &ColumnBreak) -> usize[src]

Measures the width of this cell.

Arguments

  • self - The table cell being measured.
  • column_break - The column break for this cell.

Trait Implementations

impl Debug for TableCell[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.