def open.header.valid
mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockReader.bend:381
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/coordinator/QueuePolicy.bend as QueuePolicy
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
381def open.header.valid(
382 file: File,
383 +size: Nat,
384 header: Bytes.Bytes,
385 total: U32,
386 block_count: U32,
387 size_valid: Bool
388) -> IO(Result<&1, &1, U32 & String, Reader>):
389 match size_valid:
390 case False{}:
391 open.failed(file, corruption("byte SST exceeds reader metadata bounds"))
392 case True{}:
393 open.header.index.counts(file, size, header, total,
394 QueuePolicy.nat.clone.pair(U32.to_nat(block_count)))