def measure_key_body_read

mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:977

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/ByteWal.bend as ByteWal
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

977# Handles measure key body read.
978def measure_key_body_read(
979  +used: Nat,
980  key: Bytes.Bytes,
981  +payload_length: U32,
982  file: File
983) -> IO(Result<&1, &1, U32 & String, ByteWal.ValueMetadata>):
984  do IO<Result<&1, &1, U32 & String, ByteWal.ValueMetadata>>:
985    block : File & Result<&1, &1, U32 & String, Bytes.Bytes> <-
986      Fs.read_at(file, U32.from_nat(Nat.add(20n, used)),
987        U32.add(payload_length, 40))
988    measure_key_body_result(key, block)

Uses (15)

Used by (1)