pub enum TableLayout {
Kv,
Db,
Custom(CustomLayout),
}Expand description
How the table stage interprets a row grid. Chosen per table source
((format, path, layout) / (format, path, sheet, layout) tuples),
per formats entry ((format, [exts], layout)), or passed
explicitly to parse_table; everything else
uses the format’s default —
Format::default_layout: kv for
csv, db for excel/ods. Converts from a layout id string
("kv"/"kvf", "db") or a CustomLayout.
Variants§
Kv
key,value[,format] positional rows — one config entry per row.
The default for csv.
Db
A database-style grid: the first (non-blank) row holds the keys,
the second always the type ids (an empty cell = auto), every
following row is one record. Parses to an array of one object
per record: [[a,b],[i8,str],[4,x],[5,y]] →
[{a:4,b:"x"},{a:5,b:"y"}]. Empty cells are omitted from their
record (sparse tables give sparse objects). The default for the
spreadsheet formats (excel/ods). A grid without a
type row is a CustomLayout that inserts a row of auto cells
after the header and delegates back to Db (see the
xlsx-sheets example).
Custom(CustomLayout)
A user callback over the raw rows — see CustomLayout.
Implementations§
Trait Implementations§
Source§impl Clone for TableLayout
impl Clone for TableLayout
Source§impl Debug for TableLayout
impl Debug for TableLayout
Source§impl Default for TableLayout
impl Default for TableLayout
Source§impl From<&str> for TableLayout
impl From<&str> for TableLayout
Source§fn from(id: &str) -> Self
fn from(id: &str) -> Self
Panics on an unknown id — this is config-time code. See
TableLayout::from_id for the accepted spellings.