ByteBlockReader.route.loop: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader Lines 889-919 of mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&start_line=889&end_line=919 import Base import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo import mylsm-lsm-store@0.6.0.1/src/scan/BlockRoutePolicy.bend as BlockRoutePolicy import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes def route.loop(fuel: Nat, pending: RouteState) -> IO(Result<&1, &1, U32 & String, Reader>): match fuel: case 0n: route.exhausted(pending) case 1n+rest: match pending: case RouteNeed{file, state, context, key, +search}: do IO>: next : RouteState <- route.need(file, state, context, key, search, BlockRoutePolicy.active(search)) route.loop(rest, next) case RouteSelect{reader, block}: seek_block_after_validation(reader, U32.from_nat(block)) case RouteRecordRead{pair, state, context, key, search, mid}: route.loop(rest, route.record.parsed(state, context, key, search, mid, SstStreamIo.read.exact.state(pair))) case RouteSeparatorNeed{file, state, context, key, search, mid, offset, +length, separator_start}: do IO>: raw : File & Result<&1, &1, U32 & String, Bytes.Bytes> <- Fs.read_at(file, U32.from_nat(Nat.add(separator_start, offset)), length) route.loop(rest, RouteSeparatorRead{ read_at.exact.pair(length, raw), state, context, key, search, mid}) case RouteSeparatorRead{pair, state, context, key, search, mid}: route.loop(rest, route.separator.parsed(state, context, key, search, mid, SstStreamIo.read.exact.state(pair))) case RouteCompare{file, state, context, key, search, mid, separator}: route.loop(rest, route.compare.copies(file, state, context, search, mid, separator, ByteMemTable.bytes.clone(key))) case RouteFailed{file, error}: route.close.failed(file, error) Uses (25): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add 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=Base/base.bend&name=U32.from_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=bytes.clone https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/Fs.bend&name=read_at https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend&name=read.exact.state https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/BlockRoutePolicy.bend&name=active https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=Reader https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=RouteState https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=read_at.exact.pair https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.close.failed https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.compare.copies https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.exhausted https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.need https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.record.parsed https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.separator.parsed https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=seek_block_after_validation