Skip to main content

truecalc_workbook/
table.rs

1use serde::{Deserialize, Serialize};
2
3/// A workbook-scoped table declaration (structured-references spec §4).
4/// Mirrors [`crate::named_range::NamedRange`]'s shape exactly: `{name, ref}`.
5/// The range's first row is always the header row in v1 — no separate
6/// `headerRow` field (nothing needs the header anywhere else yet).
7#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
8#[serde(deny_unknown_fields)]
9pub struct Table {
10    /// The table's name, e.g. `Recipe`. Unique across the workbook among
11    /// both table names and named-range names (case-insensitive).
12    pub name: String,
13    /// Canonical sheet-qualified A1 range: `Sheet!A1:D12`. Always a range
14    /// (never collapses to a single-cell form, even for a one-data-row table).
15    #[serde(rename = "ref")]
16    pub r#ref: String,
17}
18
19#[cfg(test)]
20mod tests;