def header.entry_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
139def header.entry_count.checked(input: Bytes.Bytes, valid: Bool) -> Result<&1, &1, Error, Header>:
140 match valid:
141 case False{}: Fail{ResourceLimit{}}
142 case True{}: header.block_count(Bytes.get.u32be(input, 16))