//! Raw input relations with positional columns. //! //! Tables are the input to atom scans. They carry no column names: positions //! are matched against an [`AtomPattern`](crate::atom::AtomPattern). use crate::value::Value; #[derive(Debug, Clone)] pub struct Table { pub arity: usize, pub rows: Vec>, } impl Table { #[must_use] pub fn new(arity: usize) -> Self { Self { arity, rows: Vec::new(), } } /// # Panics /// Panics if `row.len() != self.arity`. pub fn push(&mut self, row: Vec) { assert_eq!( row.len(), self.arity, "row arity mismatch: expected {}, got {}", self.arity, row.len(), ); self.rows.push(row); } }