Struct term_table::table_cell::TableCell[][src]

pub struct TableCell<'data> {
    pub data: Cow<'data, str>,
    pub col_span: usize,
    pub alignment: Alignment,
    pub pad_content: bool,
}

A table cell containing some str data.

A cell may span multiple columns by setting the value of col_span.

pad_content will add a space to either side of the cell's content.AsRef

Fields

data: Cow<'data, str>col_span: usizealignment: Alignmentpad_content: bool

Implementations

impl<'data> TableCell<'data>[src]

pub fn new<T>(data: T) -> TableCell<'data> where
    T: ToString
[src]

pub fn new_with_col_span<T>(data: T, col_span: usize) -> TableCell<'data> where
    T: ToString
[src]

pub fn new_with_alignment<T>(
    data: T,
    col_span: usize,
    alignment: Alignment
) -> TableCell<'data> where
    T: ToString
[src]

pub fn new_with_alignment_and_padding<T>(
    data: T,
    col_span: usize,
    alignment: Alignment,
    pad_content: bool
) -> TableCell<'data> where
    T: ToString
[src]

pub fn width(&self) -> usize[src]

Calculates the width of the cell.

New line characters are taken into account during the calculation.

pub fn split_width(&self) -> f32[src]

The width of the cell's content divided by its col_span value.

pub fn min_width(&self) -> usize[src]

The minium width required to display the cell properly

pub fn wrapped_content(&self, width: usize) -> Vec<String>[src]

Wraps the cell's content to the provided width.

New line characters are taken into account.

Trait Implementations

impl<'data> Clone for TableCell<'data>[src]

impl<'data> Debug for TableCell<'data>[src]

impl<'data, T> From<T> for TableCell<'data> where
    T: ToString
[src]

Auto Trait Implementations

impl<'data> RefUnwindSafe for TableCell<'data>[src]

impl<'data> Send for TableCell<'data>[src]

impl<'data> Sync for TableCell<'data>[src]

impl<'data> Unpin for TableCell<'data>[src]

impl<'data> UnwindSafe for TableCell<'data>[src]

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<!> for T[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.