ParseMatchCallback<R> typedef

ParseMatchCallback<R> = void Function(R value, {required String buffer, required int start, required int stop})

Callback invoked when a match is produced during streaming or iteration.

In chunked stream parsing (ParseDecoderSink), start and stop are global offsets from the beginning of the stream while buffer is only the active chunk window, so do not index buffer with start or stop.

Implementation

typedef ParseMatchCallback<R> = void Function(
  R value, {
  required int start,
  required int stop,
  required String buffer,
});