tabled
This library provides an interface to pretty print vectors of structs
Get started
The common and probably the best way to begin is to annotate your type with
#[derive(Tabled)]. You can also implement it on your own as well.
There's an example. Precisely it can be printed and you
will see the content of expected variable as an output.
use ;
let languages = vec!;
let table = table;
let expected = "+------+----------------+---------------+\n\
| name | designed_by | invented_year |\n\
+------+----------------+---------------+\n\
| C | Dennis Ritchie | 1972 |\n\
+------+----------------+---------------+\n\
| Rust | Graydon Hoare | 2010 |\n\
+------+----------------+---------------+\n";
assert_eq!;
It should have a clue in what why print the field
accordingly each field should implement std::fmt::Display
The example below is not compiled
# use Tabled;
;
This crate implement the trait for default types. Therefore you can use this to print one column vectors
use ;
let some_numbers = ;
let table = table;
License: Apache-2.0