forEachField method
Visits every field once, without allocating per field.
Implementation
void forEachField(void Function(DocCursor cursor) visit) {
final cursor = DocCursor._(buffer, bodyStart, bodyEnd);
while (cursor.next()) {
visit(cursor);
}
}