[go: up one dir, main page]

[][src]Struct comfy_table::table::Table

pub struct Table {
    pub table_style: TableStyle,
    // some fields omitted
}

The representation of a table.

Fields

table_style: TableStyle

Methods

impl Table[src]

pub fn new() -> Self[src]

Create a new table with default ASCII styling, no rows and a header

pub fn to_string(&mut self) -> String[src]

pub fn set_header<T: ToRow>(&mut self, row: T) -> &mut Self[src]

Set the header row of the table. This is usually the title of each column.

pub fn get_header(&self) -> Option<&Row>[src]

pub fn load_preset(&mut self, preset: &str)[src]

Convenience wrapper for table.table_style.load_preset()

pub fn apply_modifier(&mut self, modifier: &str)[src]

Convenience wrapper for table.table_style.apply_modifier()

pub fn add_row<T: ToRow>(&mut self, row: T) -> &mut Self[src]

Add a new row to the table.

pub fn get_column(&self, index: usize) -> Option<&Column>[src]

pub fn get_column_mut(&mut self, index: usize) -> Option<&mut Column>[src]

pub fn column_max_content_widths(&self) -> Vec<u16>[src]

Return a vector representing the maximum amount of characters in any line of this column. This is mostly needed for internal testing and formatting, but it can be interesting if you want to check how wide the longest line for each column is during runtime.

Auto Trait Implementations

impl RefUnwindSafe for Table

impl Send for Table

impl Sync for Table

impl Unpin for Table

impl UnwindSafe for Table

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.