LegacyWal.replay.measured: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend as LegacyWal Lines 389-394 of mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend&start_line=389&end_line=394 import Base import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Derives replay fuel from the source size and validates the header before decoding frames. def replay.measured(pair: Bytes.Bytes & U32) -> ReplayResult: match pair: case (bytes, size): replay.header.pair(Bytes.slice(bytes, 0, 8), Nat.add(3n, Nat.mul(6n, Nat.div(U32.to_nat(size), 40n)))) Uses (11): 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.div 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=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.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=bend-kit-bytes@0.3.3.0/bytes.bend&name=slice https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend&name=ReplayResult https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend&name=replay.header.pair