Struct PbfNodeIterable

Foreach adapter over semantic OSM nodes in one already-loaded PBF file.

struct PbfNodeIterable;

This is deliberately a foreach/opApply adapter rather than a Phobos InputRange. The underlying PBF decoders are synchronous push decoders; using opApply preserves that execution model and lets D propagate break, enclosing return, and outer goto through the delegate's exact control value without materializing elements or introducing a coroutine runtime.

A natural traversal to end-of-file retains the same whole-file validation scope as PbfReader.read: Ways and Relations are decoded/validated but are not delivered to the node foreach body. If iteration stops early, parsing stops immediately after the node that produced the foreach control value, so the unvisited file suffix is deliberately not validated.

Scratch storage is local to each opApply invocation. It may grow through the garbage collector in the same cases as a fresh PbfReaderWorkspace, but there is no per-node allocation or owned node materialization.

After foreach finishes, inspect status. A successful natural traversal has status.ok == true and completed == true. A user break has status.ok == true and completed == false. A decode failure has status.ok == false and completed == false.

PbfNodeIterable.init represents an empty input. Iterating it produces no nodes and records PbfReadError.missingHeader.

Properties

NameTypeDescription
completed[get] boolTrue only when the most recent traversal reached the end of the file.
status[get] PbfReadStatusStatus from the most recent foreach traversal.

Methods

NameDescription
opApply (dg) Iterate semantic nodes from an @system foreach body.
opApply (dg) Iterate semantic nodes from an @safe foreach body.