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]

#[must_use]
pub fn empty() -> Cell
[src]

#[must_use]
pub fn new(contents: Vec<Content>, base_style: ContentStyle) -> 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]

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]

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]

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]

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]

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 Cell[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl RefUnwindSafe for Cell

impl Send for Cell

impl Sync for Cell

impl Unpin for Cell

impl UnwindSafe for Cell

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.