SstCursor.scan.loop: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend as SstCursor Lines 222-245 of mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend&start_line=222&end_line=245 import Base import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader def scan.loop(fuel: Nat, state: ScanState) -> IO(Step): match fuel: case 0n: scan.exhausted(state) case 1n+rest: match state: case ScanNeed{reader, bounds}: do IO: result : Result<&1, &1, U32 & String, ByteBlockReader.Step> <- ByteBlockReader.next(reader) scan.loop(rest, ScanRead{result, bounds}) case ScanRead{result, bounds}: match result: case Fail{error}: IO.pure(Step, Error{error}) case Done{ByteBlockReader.End{}}: IO.pure(Step, End{}) case Done{ByteBlockReader.Block{reader, entries}}: scan.loop(rest, ScanBlock{reader, entries, bounds}) case ScanBlock{reader, entries, bounds}: match entries: case Nil{}: scan.loop(rest, ScanNeed{reader, bounds}) case Con{entry, tail}: scan.entry(entry, ByteBlockReader.EntryReady{reader, tail}, bounds) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=EntryCursor https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=Step https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=next https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend&name=ScanState https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend&name=Step https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend&name=scan.entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/SstCursor.bend&name=scan.exhausted