text-grid 0.4.1

A library to create formatted plain-text tables.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
    use text_grid::*;
    struct RowData {
        a: u32,
        b: u32,
    }
    impl Cells for RowData {
        fn fmt(f: &mut CellsFormatter<Self>) {
            f.column("a", |s| s.a);
            f.column("b", |s| s.b);
        }
    }

    let rows = [RowData { a: 300, b: 1 }, RowData { a: 2, b: 200 }];
    print!("{}", to_grid(rows));
}