tablefy
use Tablefy;
use Tablefy;
use ;
// This struct now implements the tablefy trait
+-----------+------------+----------+-------+
| something | otherthing | newthing | maybe |
+===========+============+==========+=======+
| a | 2 | 3 | |
+-----------+------------+----------+-------+
| b | 3 | 4 | x |
+-----------+------------+----------+-------+
This crate serves as an extension of prettytable
by specifying a Tablefy
trait in order to turn any struct (whose members implement Display) to turn into
a Table
object.
As a result, this means that prettytable
is a dependency. You won't be able to use this crate without
also adding prettytable
.
Future updates
Currently there are two major improvements I have in mind for this crate.
- Fields can be tagged to customize the header name.
- Fields can be tagged to print using
{:?}
and{:#?}
instead of{}