def open.header.index.length.exact

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

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/SstStreamIo.bend as SstStreamIo
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

347def open.header.index.length.exact(
348  pair: File & Result<&1, &1, U32 & String, SstStreamIo.ExactResult>,
349  +size: Nat,
350  header: Bytes.Bytes,
351  total: U32,
352  block_count: U32,
353  block_count_nat: U32
354) -> IO(Result<&1, &1, U32 & String, Reader>):
355  match pair:
356    case (file, Fail{error}): open.failed(file, error)
357    case (file, Done{SstStreamIo.ExactResult{bytes, complete}}):
358      match complete:
359        case True{}:
360          open.header.index.length.bytes(file, size, header, total,
361            block_count, block_count_nat, Done{bytes})
362        case False{}:
363          open.failed(file, corruption("truncated byte SST footer index length"))

Uses (15)

Used by (1)