Module osm.io.pbf.framing

Zero-copy framing of OSMPBF file blocks.

A PBF file is a sequence of a four-byte network-order BlobHeader length, the serialized BlobHeader itself, and the serialized Blob body whose length is given by BlobHeader.datasize. This module extracts one complete block from a bounded WireCursor without allocation or decompression.

Parsing is transactional with respect to the caller's cursor: on any error the supplied cursor remains unchanged. A clean empty cursor is reported as end-of-input, whereas a trailing one-to-three-byte prefix is corruption.

Date

2026-09-12

Functions

NameDescription
readFileBlock(cursor, sequence, block, status) Decode one complete PBF file block from cursor.

Structs

NameDescription
FileBlockView Borrowed view of one complete serialized PBF file block.

Enums

NameDescription
FrameReadResult Result category returned by readFileBlock.