pub struct Address {
pub row: u32,
pub column: u32,
}Expand description
A parsed, in-bounds A1 address: 1-based (row, column).
The grid key of a Worksheet. Every constructor is
bounds-checked (rows 1..=10_000_000, columns 1..=18_278), so an
Address value is always serializable to a valid A1 key.
Fields§
§row: u321-based row.
column: u321-based column (A = 1).
Implementations§
Source§impl Address
impl Address
Sourcepub fn new(row: u32, column: u32) -> Option<Self>
pub fn new(row: u32, column: u32) -> Option<Self>
Builds an address from 1-based (row, column), enforcing the address
bounds (rows 1..=10_000_000, columns 1..=18_278). Returns None
when either coordinate is 0 or out of bounds.
Sourcepub fn from_a1(key: &str) -> Option<Self>
pub fn from_a1(key: &str) -> Option<Self>
Parses a plain uppercase A1 address (e.g. A1, BC42), enforcing the
normative key syntax (^[A-Z]{1,3}[1-9][0-9]{0,7}$) and the address
bounds (schema spec §3). Returns None on any malformed or
out-of-bounds key.
Sourcepub fn to_a1(&self) -> String
pub fn to_a1(&self) -> String
Re-emits the plain-uppercase A1 key (A1, BC42) — the inverse of
Address::from_a1 and the exact key the canonical serializer writes.