Skip to main content

st

Macro st 

Source
macro_rules! st {
    ($name:literal, $($t:expr),+ $(,)?) => { ... };
    ($name:literal) => { ... };
    ($($t:expr),+ $(,)?) => { ... };
}
Expand description

Ergonomic constructor for a SuperTable from named table batches.

Each batch argument may be a Table or Arc<Table>; both flow through .into() into the required Arc<Table>. When the first argument is a string literal it becomes the SuperTable name; otherwise the first batch’s name is used.

§Forms

  • st!("name", batch1, batch2, ...) - named SuperTable from batches.
  • st!(batch1, batch2, ...) - name derived from the first batch.
  • st!("name") - empty SuperTable with the supplied name.

§Example

use minarrow::{fa_i32, st, tbl};

let a = tbl!("batch", fa_i32!("x", 1, 2));
let b = tbl!("batch", fa_i32!("x", 3, 4));
let s = st!("rolling", a, b);
assert_eq!(s.name, "rolling");
assert_eq!(s.n_rows, 4);

§Note

The named form requires a string literal for the name. For a dynamic String name use SuperTable::from_batches(..., Some(name)) directly.