tablefy
To check for updates see the changelog.
use Tablefy;
use Tablefy;
// This struct now implements the tablefy trait
+--------------------+---------------+------------------+-------+
| Hmm... Nice Header | We Have Here! | Don't You Agree? | maybe |
+====================+===============+==================+=======+
| a | 2 | 3 | |
+--------------------+---------------+------------------+-------+
| b | 3 | 4 | x |
+--------------------+---------------+------------------+-------+
| c | 5 | 8 | |
+--------------------+---------------+------------------+-------+
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
.
If you'd like to get the full functionality of this crate (with proc_macros), be sure to check out tablefy_derive!.
Future updates
Currently there are two major improvements I have in mind for this crate.
Fields can be tagged to customize the header name.- This has now been implemented! Be sure to update
tablefy_derive
.
- This has now been implemented! Be sure to update
- Fields can be tagged to print using
{:?}
and{:#?}
instead of{}
License: MPL-2.0