ByteBlockReader.seek_key_after_validation: 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 921-938 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=921&end_line=938 import Base 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 # Routes a lower key to the last block whose separator does not exceed it. def seek_key_after_validation( reader: Reader, key: Bytes.Bytes ) -> IO(Result<&1, &1, U32 & String, Reader>): match reader: case Reader{file, state}: match state: case State{+size, header, +index_offset, used, total, +block_count, next_block, decoded, root_hash, index_hash, last_key, selected}: +count = U32.to_nat(block_count) +fuel = Nat.add(Nat.mul(8n, count), 8n) context : RouteContext = RouteContext{size, index_offset, count} retained_state : State = State{size, header, index_offset, used, total, block_count, next_block, decoded, root_hash, index_hash, last_key, selected} route.loop(fuel, RouteNeed{file, retained_state, context, key, BlockRoutePolicy.Search{0n, count, 0n}}) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mul 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.to_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/scan/BlockRoutePolicy.bend&name=Search 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=RouteContext 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=State https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.loop