Expand description
Reading a tilepack: parse front matter from a prefix, then address tiles by byte range or by slice.
Structs§
- Front
Matter - Parsed header, descriptors, layout, and offset index — everything needed to plan tile fetches without touching a single tile blob.
- Prelude
- Parsed header, descriptors, and layout — the prelude BEFORE the offset
index. Everything a reader needs to plan lazy index lookups: hold
these ~100 bytes, and any tile is locatable with one 16-byte read into
the index region (
Prelude::index_entry_span) plus one blob read. - Sparse
Reader - A tilepack read lazily from a seekable source: only the
Preludeis parsed up front, and each tile lookup reads its 16-byte index entry and then the blob — three bounded reads total, O(1) memory regardless of index size. TheRead + Seektwin of the HTTP lazy-range pattern (and its executable specification: the oracle test holds it equal toTilepackReader). - Tilepack
Reader - A tilepack read from a seekable source, fetching tile bytes on demand.
- Tilepack
View - A tilepack held entirely in memory: address tiles as byte slices.
Functions§
- required_
len - The smallest prefix length that lets parsing advance past its current
point, given the bytes in
prefix. Grows monotonically across calls:HEADER_LEN, then the descriptor-table end, then the full front matter.