macro_rules! tbl {
($name:expr, $($col:expr),+ $(,)?) => { ... };
($name:expr) => { ... };
}Expand description
Ergonomic constructor for a Table from named columns.
The first argument is the table name. Subsequent arguments are
FieldArray columns, comma-separated. An empty table is built when
only a name is provided.
ยงExample
use minarrow::{fa_f64, fa_i32, tbl};
let t = tbl!("orders",
fa_i32!("id", 1, 2, 3),
fa_f64!("qty", 10.0, 20.0, 30.0),
);
assert_eq!(t.name, "orders");
assert_eq!(t.cols.len(), 2);
assert_eq!(t.n_rows, 3);