ByteBlockReader.route.record.words: 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 757-780 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=757&end_line=780 import Base import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes import mylsm-lsm-store@0.6.0.1/src/scan/BlockIndexFormatPolicy.bend as BlockIndexFormatPolicy 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.record.words( file: File, state: State, context: RouteContext, key: Bytes.Bytes, search: BlockRoutePolicy.Search, mid: Nat, words: Maybe<&2, U32> & Maybe<&2, U32> ) -> RouteState: match context: case RouteContext{+size, +index_offset, +block_count}: match words: case (Some{+offset}, Some{+length}): +index_length = Nat.sub(size, Nat.add(index_offset, 44n)) +fixed_bytes = Nat.add(8n, Nat.mul(block_count, 16n)) +region_length = Nat.sub(index_length, fixed_bytes) +separator_start = Nat.add(index_offset, fixed_bytes) route.record.bounds(file, state, context, key, search, mid, offset, length, separator_start, BlockIndexFormatPolicy.separator_valid(U32.to_nat(offset), U32.to_nat(length), region_length) && U32.is_le(length, StorageBytes.MAX_BLOCK_BYTES())) case _: RouteFailed{file, corruption("byte SST separator fields are missing")} Uses (21): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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=Nat.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le 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/StorageBytes.bend&name=MAX_BLOCK_BYTES https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/BlockIndexFormatPolicy.bend&name=separator_valid 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=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=corruption https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend&name=route.record.bounds