[][src]Struct term_table::row::Row

pub struct Row<'data> {
    pub cells: Vec<TableCell<'data>>,
    pub has_separator: bool,
}

A set of table cells

Fields

cells: Vec<TableCell<'data>>has_separator: bool

Whether the row should have a top boarder or not

Methods

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

pub fn new<I, T>(cells: I) -> Row<'data> where
    T: Into<TableCell<'data>>,
    I: IntoIterator<Item = T>, 
[src]

pub fn format(&self, column_widths: &[usize], style: &TableStyle) -> String[src]

Formats a row based on the provided table style

pub fn gen_separator(
    &self,
    column_widths: &[usize],
    style: &TableStyle,
    row_position: RowPosition,
    previous_separator: Option<String>
) -> String
[src]

Generates the top separator for a row.

The previous seperator is used to determine junction characters

pub fn split_column_widths(&self) -> Vec<(f32, usize)>[src]

Returns a vector of split cell widths.

A split width is the cell's total width divided by it's col_span value.

Each cell's split width value is pushed into the resulting vector col_span times. Returns a vec of tuples containing the cell width and the min cell width

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

Number of columns in the row.

This is the sum of all cell's col_span values

Trait Implementations

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

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

Auto Trait Implementations

impl<'data> RefUnwindSafe for Row<'data>

impl<'data> Send for Row<'data>

impl<'data> Sync for Row<'data>

impl<'data> Unpin for Row<'data>

impl<'data> UnwindSafe for Row<'data>

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> 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.