def header.block_count.checked
import mylsm-lsm-store@0.6.0.1/src/transfer/Restore.bend as Restoreimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
126def header.block_count.checked(input: Bytes.Bytes, valid: Bool) -> Result<&1, &1, Error, Header>:
127 match valid:
128 case False{}: Fail{ResourceLimit{}}
129 case True{}: header.entry_count.read(Bytes.get.u32be(input, 12))