ProcessTree.visit

void visit(void delegate(Process, int depth) visitor)

Visits all processes in the tree using a visitor function.

Parameters

visitorA delegate called for each process with its depth. Example:
tree.visit((proc, depth) {
  import std.stdio : writeln;
  writeln("  ".repeat(depth), proc.name());
});