PbfReader.read - multiple declarations

Function PbfReader.read

Decode one complete already-loaded .osm.pbf byte sequence.

bool read(Handler)(
  const(ubyte)[] input,
  ref PbfReaderWorkspace workspace,
  ref Handler handler,
  out PbfReadSummary summary,
  out PbfReadStatus status
) @safe;

Parameters

NameDescription
input Complete encoded PBF file bytes. They must remain valid for the duration of this call.
workspace Caller-owned reusable scratch storage. The first read may grow its internal arrays; later reads reuse retained capacity.
handler Consumer receiving any implemented node/way/relation callbacks synchronously.
summary Receives complete entity/block counts on success.
status Receives success or a high-level error plus diagnostic detail.

Returns

true after the complete file has been validated and decoded; false on the first failure.

Notes

This function does not materialize an owned OSM model. It may allocate only when reusable workspace must grow. Element decoder hot paths stay allocation-free and statically dispatched.

Function PbfReader.read

Decode one complete PBF from a bounded generic ByteSource.

bool read(Handler)(
  scope ByteSource source,
  ref PbfReaderWorkspace workspace,
  ref Handler handler,
  out PbfReadSummary summary,
  out PbfSourceReadStatus sourceStatus
) @safe;

The source is consumed monotonically through readSome. Only the current BlobHeader, serialized Blob and existing reusable decode workspace are retained; the complete encoded resource is never materialized by this overload.

A clean EOF at a block boundary completes the file. EOF inside a frame is a malformed/truncated PBF error, while generic source failures remain explicit in PbfSourceReadStatus.transportError.