def next.block.read
mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:1420
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/Fs.bend as Fs
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
1420def next.block.read(
1421 file: File,
1422 state: State
1423) -> IO(Result<&1, &1, U32 & String, Step>):
1424 match state:
1425 case State{_, _, _, +used, _, _, _, _, _, _, _, _}:
1426 do IO<Result<&1, &1, U32 & String, Step>>:
1427 raw : File & Result<&1, &1, U32 & String, Bytes.Bytes> <-
1428 Fs.read_at(file, U32.from_nat(Nat.add(20n, used)), 8)
1429 next.block.header.pair(state, read_at.exact.pair(8, raw))