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 derive
d— see their documentation
for more information about requirements, and about types they are automatically
implemented on.
Structs§
- Column
- A column in a table.
- Table
Formatter - The main structure used for table printing. This stores information about columns and has methods for writing table results to a Write object.
Enums§
- Column
Align - Represents the alignment of data within a table’s column.
- Column
Size - Represents the size of a table’s column.
Traits§
- Debug
Table Row - 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. - Default
Table Style - 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. - Display
Table Row - Trait to allow a value to be converted into a row of information for a table.