Struct PbfWhereIterable
Push-filter adapter over one element-specific PBF foreach traversal.
struct PbfWhereIterable(Source, View, alias predicate);
This is deliberately not a Phobos InputRange. It retains the synchronous opApply execution model of pbfNodes/pbfWays/pbfRelations, applies a compile-time predicate to each valid borrowed element, and forwards only matching elements to the final foreach body.
The adapter owns only a copy of the source traversal value. It does not materialize OSM elements, widen borrowed lifetimes, or skip the parsing and validation work required to produce a valid element view.
Consumers normally obtain this type through UFCS:
auto highways = pbfWays(input) .where!hasHighway;
foreach (scope ref WayView way; highways)
{
// matching borrowed Way only
}
A natural traversal preserves the source whole-file validation scope. Breaking from the final foreach body stops parsing immediately and leaves completed false, exactly like the unfiltered source traversal.
Constructors
| Name | Description |
|---|---|
this
(value)
|
Fields
| Name | Type | Description |
|---|---|---|
source
|
Source |
Properties
| Name | Type | Description |
|---|---|---|
completed[get]
|
bool | True only when the most recent traversal reached end-of-file. |
status[get]
|
PbfReadStatus | Status from the most recent traversal. |
Methods
| Name | Description |
|---|---|
opApply
(dg)
|
Iterate matching elements from an @safe foreach body. |
opApply
(dg)
|
Iterate matching elements from an @system foreach body. |