def next.block.length.state
mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:1359
import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockReader.bend as ByteBlockReader
import Base
import mylsm-lsm-store@0.6.0.1/src/StorageBytes.bend as StorageBytes
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
1359def next.block.length.state(
1360 file: File,
1361 state: State,
1362 block_header: Bytes.Bytes,
1363 +payload_length: U32
1364) -> IO(Result<&1, &1, U32 & String, Step>):
1365 match state:
1366 case State{_, _, +index_offset, +used, _, _, _, _, _, _, _, _}:
1367 next.body.valid(file, state, block_header, used, payload_length,
1368 U32.is_le(payload_length, StorageBytes.MAX_BLOCK_BYTES()) &&
1369 Nat.is_le(Nat.add(used,
1370 U32.to_nat(U32.add(payload_length, 40))), index_offset))