Expand description
2DA binary table support.
2DA V2.b binary reader and writer.
2DA is a compact table format used for gameplay metadata. The binary form stores column headers, row labels, a cell-offset matrix, and a shared string table.
§Format Layout
+------------------------------+
| "2DA " + "V2.b" + '\n' |
+------------------------------+
| Header row text |
| tab-separated, NUL-terminated|
+------------------------------+
| Row count (u32) |
+------------------------------+
| Row labels |
| each terminated by '\t' |
+------------------------------+
| Cell offset table |
| u16 * (rows * columns) |
+------------------------------+
| String table blob |
| NUL-terminated cell strings |
+------------------------------+Writer output is deterministic: repeated cell strings are deduplicated in the string table while preserving row and column order.
Structs§
- TwoDa
- In-memory representation of a binary 2DA table.
- TwoDa
Binary Options - Encoding options for binary 2DA reader/writer operations.
- TwoDa
Row - One row in a 2DA table.
Enums§
- TwoDa
Binary Error - Errors produced while parsing or serializing binary 2DA data.
Functions§
- read_
twoda - Reads a binary 2DA from a reader.
- read_
twoda_ auto - Auto-detects the format from file extension and reads accordingly.
- read_
twoda_ from_ bytes - Reads a binary 2DA (
2DA V2.b) from in-memory bytes. - read_
twoda_ from_ bytes_ with_ options - Reads a binary 2DA (
2DA V2.b) from in-memory bytes with explicit text options. - read_
twoda_ with_ options - Reads a binary 2DA from a reader with explicit text options.
- write_
twoda - Writes a binary 2DA (
2DA V2.b) to a writer. - write_
twoda_ to_ vec - Serializes a binary 2DA to a byte vector.
- write_
twoda_ to_ vec_ with_ options - Serializes a binary 2DA to a byte vector with explicit text options.
- write_
twoda_ with_ options - Writes a binary 2DA (
2DA V2.b) to a writer with explicit text options.