def read.block.header.bound
mylsm-lsm-store@0.6.0.1 · src/SstStreamIo.bend:149
import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo
import Base
import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
149def read.block.header.bound(
150 file: File,
151 +size: Nat,
152 +used: Nat,
153 parser: SstFile.StreamState,
154 header: Bytes.Bytes,
155 +tail_len: U32,
156 valid: Bool
157) -> StreamReadState:
158 match valid:
159 case False{}:
160 ReadClose{file, Fail{(corruption_error_code(), "truncated SST block")}}
161 case True{}:
162 ReadBlockBody{file, size, used, parser, header, tail_len}