csv_to_table 0.9.0

A library for pretty print CSV as a table
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! This example demonstrates reading a csv string to a [`Table`] struct.
//!
//! * Note the necessary step of representing the string as a byte array.

fn main() {
    let syscalls = "\
        0,INDIR,,\"int sys_syscall(int number, ...)\"\n\
        1,STD,,\"void sys_exit(int rval)\"\n\
        2,STD,,\"int sys_fork(void)\"\n\
        3,STD,NOLOCK,\"ssize_t sys_read(int fd, void *buf, size_t nbyte)\"\n\
        4,STD,NOLOCK,\"ssize_t sys_write(int fd, const void *buf, size_t nbyte)\"";

    let table = csv_to_table::from_reader(syscalls.as_bytes()).unwrap();

    println!("{table}")
}