pub struct Table { /* private fields */ }
Expand description

An owned printable table

Implementations

Create a table from a CSV string

For more customisability use from_csv()

Create a table from a CSV file

For more customisability use from_csv()

Create a table from a CSV reader

Write the table to the specified writer.

Write the table to the specified writer.

This allows for format customisation.

Create an empty table

Create a table initialized with rows

Change the table format. Eg : Separators

Get a mutable reference to the internal format

Get the number of rows

Check if the table is empty

Set the optional title lines

Unset the title line

Get a mutable reference to a row

Get an immutable reference to a row

Append a row in the table, transferring ownership of this row to the table and returning a mutable reference to the row

Append an empty row in the table. Return a mutable reference to this new row.

Insert row at the position index, and return a mutable reference to this row. If index is higher than current numbers of rows, row is appended at the end of the table

Modify a single element in the table

Remove the row at position index. Silently skip if the row does not exist

Return an iterator over the immutable cells of the column specified by column

Return an iterator over the mutable cells of the column specified by column

Returns an iterator over immutable rows

Returns an iterator over mutable rows

Print the table to out and returns the number of lines printed, or an error

Print the table to terminal out, applying styles when needed and returns the number of lines printed, or an error

Print the table to standard output. Colors won’t be displayed unless stdout is a tty terminal, or force_colorize is set to true. In ANSI terminals, colors are displayed using ANSI escape characters. When for example the output is redirected to a file, or piped to another program, the output is considered as not beeing tty, and ANSI escape characters won’t be displayed unless force colorize is set to true.

Returns

A Result holding the number of lines printed, or an io::Error if any failure happens

Print the table to standard output. Colors won’t be displayed unless stdout is a tty terminal. This means that if stdout is redirected to a file, or piped to another program, no color will be displayed. To force colors rendering, use print_tty() method. Any failure to print is ignored. For better control, use print_tty(). Calling printstd() is equivalent to calling print_tty(false) and ignoring the result.

Print table in HTML format to out.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Converts to this type from the input type.

Creates a value from an iterator. Read more

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Type output after slicing

Get a slice from self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.