def records.read.go
mylsm-lsm-store@0.6.0.1 · src/Wal.bend:366
import mylsm-lsm-store@0.6.0.1/src/Wal.bend as Wal
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
366def records.read.go(
367 remaining: Nat,
368 input: RecordRead,
369 reversed: List<&2, Mut>
370) -> Bytes.Cursor & Result<&1, &1, Error, List<&2, Mut>>:
371 match remaining input:
372 case 0n RecordInput{cursor, Fail{error}}:
373 (cursor, Fail{error})
374 case 0n RecordInput{cursor, Done{mut}}:
375 (cursor, Done{List.reverse(&2, Mut, mut <> reversed)})
376 case 1n+rest RecordInput{cursor, Fail{error}}:
377 (cursor, Fail{error})
378 case 1n+rest RecordInput{cursor, Done{mut}}:
379 records.read.go(rest, records.read.wrap(record.read(cursor)),
380 mut <> reversed)