Crate kitty_table

Source
Expand description

This tiny library adds methods for printing organized tables of information for debugging.

To begin printing tables, a TableFormatter should be created either using new or with from_style. The former will create a new formatter from scratch, allowing you to supply an array of Columns which dictate how the table will be printed. The latter will automatically fill in the table’s style information if your data implements DefaultTableStyle.

To actually print results using a created TableFormatter, write, debug_write, print, and debug_print may be used. They require a collection of data that implements either DisplayTableRow or DebugTableRow to work.

DebugTableRow and DefaultTableStyle may be derived— see their documentation for more information about requirements, and about types they are automatically implemented on.

Structs§

Column
A column in a table.
TableFormatter
The main structure used for table printing. This stores information about columns and has methods for writing table results to a Write object.

Enums§

ColumnAlign
Represents the alignment of data within a table’s column.
ColumnSize
Represents the size of a table’s column.

Traits§

DebugTableRow
Trait to allow a value to be converted into row of information for a debug table. This trait may be derived using #[derive(DebugTable)] so long as every field of your type implements Debug.
DefaultTableStyle
Indicates that this type has a “default column style” so columns can be auto-generated for a TableFormatter. This trait may be derived using #[derive(DefaultTableStyle)] if column style customization is unnecessary.
DisplayTableRow
Trait to allow a value to be converted into a row of information for a table.

Derive Macros§

DebugTableRow
DefaultTableStyle