nodesIn
The same, materialised.
For a caller who wants the count, or an index into it, or to iterate twice. It is O(nodes) in both time and memory where forEachNodeIn is O(1) in memory, which on a path ending in [*] over a wide array is the whole difference. The VariantNodes it holds are still views, and the lifetime rule on forEachNodeIn applies to them unchanged: the list outlives the call, the bytes behind the values do not.