pub struct PayloadHeader {Show 24 fields
pub arcs_off: u32,
pub rings_off: u32,
pub grid_off: u32,
pub release_off: u32,
pub eager_coords: u32,
pub eager_rings: u32,
pub eager_polys: u32,
pub n_arcs: u32,
pub raw_len: u32,
pub grid_deg: f32,
pub epsilon_m: f32,
pub n_features: u16,
pub ncols: u16,
pub nrows: u16,
pub uniq: u16,
pub release_len: u16,
pub flags: u16,
pub dataset: Dataset,
pub quant_bits: QuantBits,
pub simplify_algorithm: SimplifyAlgorithm,
pub geom: GeomEncoding,
pub codec: Codec,
pub density_weight_floor_e4: u16,
pub reserved: u8,
}Expand description
The container’s one fixed header record, which carries everything the
reader needs to locate every section. It sits in PLAINTEXT right after
the outer header (only the section blob after it is compressed), so
any container is inspectable and validated before decompression. The
encoder Pwrites it, the reader Preads it (both little-endian);
field order is the wire order; all offsets are relative to the section
blob that follows.
The section blob is laid out as the zone-string offsets and pool, the
geometry-dependent sections at the stored offsets, the grid tables, and
the TZBB release string at release_off.
Fields§
§arcs_off: u32The offset of the arc store (geom 0/1) or of the FullRings
coordinates (geom 2, 4-aligned).
rings_off: u32The offset of the poly→feature parent table (plus the ring records for geom 0/1).
grid_off: u32The offset of the grid tables, which hold the primary cells followed by the CSR list offsets and ids.
release_off: u32The offset of the TZBB release string (release_len bytes at the
payload tail).
eager_coords: u32The eager-cache reservation counts, which give exact Vec sizes for
preload() (the coords count is Σ referenced-arc vertex counts and
may only over-estimate).
eager_rings: u32§eager_polys: u32§n_arcs: u32The arc count (geom 0/1), which is zero when there is no arc store.
raw_len: u32The section blob’s decompressed size (so readers allocate once).
grid_deg: f32The grid cell size in degrees; fractional sizes (e.g. 0.5) are allowed.
epsilon_m: f32The simplification tolerance the asset was built with (provenance).
n_features: u16§ncols: u16The grid’s column count.
nrows: u16The grid’s row count.
uniq: u16The number of distinct border-cell candidate lists (CSR).
release_len: u16§flags: u16This field is reserved and must be zero (room for future format flags).
dataset: Dataset§quant_bits: QuantBits§simplify_algorithm: SimplifyAlgorithm§geom: GeomEncoding§codec: CodecThe section blob’s compression codec.
density_weight_floor_e4: u16The population-density weight floor in fixed-point 1e-4, where 0
means unweighted and 10000 means 1.0. Like epsilon_m, it is
provenance for the density-weighted simplification knob.
reserved: u8This byte is reserved and must be zero (it pads the header to 64 bytes).
Implementations§
Source§impl PayloadHeader
impl PayloadHeader
Sourcepub fn from_asset(bytes: &[u8]) -> Option<PayloadHeader>
pub fn from_asset(bytes: &[u8]) -> Option<PayloadHeader>
Parses the plaintext header out of a complete asset, checking the
prologue first (magic + VERSION). The result is None if the
bytes are too short, not a μTZ asset, or a different format
version. The parse reads only the first
PROLOGUE_LEN + PAYLOAD_HEADER_LEN bytes, which makes it cheap
provenance sniffing without decompression.
Trait Implementations§
Source§impl Clone for PayloadHeader
impl Clone for PayloadHeader
Source§fn clone(&self) -> PayloadHeader
fn clone(&self) -> PayloadHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more