def restore.block.count.field
mylsm-lsm-store@0.6.0.1 · src/transfer/Restore.bend:543
import mylsm-lsm-store@0.6.0.1/src/transfer/Restore.bend as Restore
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
543def restore.block.count.field(
544 pair: Bytes.Bytes & Maybe<&2, U32>,
545 +offset: Nat,
546 index: U32
547) -> Result<&1, &1, Error, BlockHeader>:
548 match pair:
549 case (input, result):
550 match result:
551 case None{}: Fail{InvalidFormat{}}
552 case Some{+record_count}:
553 restore.block.count.valid(input, offset, index, record_count,
554 U32.is_le(record_count, 16), U32.is_eq(record_count, 0))