ByteWal.decode.records.loop: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/ByteWal.bend as ByteWal Lines 799-819 of mylsm-lsm-store@0.6.0.1/src/ByteWal.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&start_line=799&end_line=819 import Base import mylsm-lsm-store@0.6.0.1/src/Wal.bend as Wal # Decodes the exact number of records declared by a WAL frame. def decode.records.loop(fuel: Nat, state: DecodeState) -> Result<&1, &1, Wal.Error, ParsedBatch>: match fuel: case 0n: Fail{Wal.Malformed{}} case 1n+rest: match state: case DecodeNext{frame, offset, remaining, reversed}: match remaining: case 0n: Done{ParsedBatch{offset, Batch{List.reverse(&1, Mutation, reversed)}}} case 1n+more: decode.records.loop(rest, DecodeRead{record.decode(frame, offset), more, reversed}) case DecodeRead{record, remaining, reversed}: match record: case RecordError{_, error}: Fail{error} case RecordDone{frame, offset, mutation}: decode.records.loop(rest, DecodeNext{frame, offset, remaining, Con{mutation, reversed}}) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=Batch https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=DecodeState https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=DecodedRecord https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=Mutation https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=ParsedBatch https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteWal.bend&name=record.decode https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Wal.bend&name=Error