def restore.block.count.valid

mylsm-lsm-store@0.6.0.1 · src/transfer/Restore.bend:526

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

526def restore.block.count.valid(
527  input: Bytes.Bytes,
528  +offset: Nat,
529  index: U32,
530  record_count: U32,
531  within_limit: Bool,
532  empty: Bool
533) -> Result<&1, &1, Error, BlockHeader>:
534  match within_limit:
535    case False{}: Fail{ResourceLimit{}}
536    case True{}:
537      match empty:
538        case True{}: Fail{InvalidFormat{}}
539        case False{}:
540          restore.block.frame.field(Bytes.get.u32be(input,
541            U32.from_nat(Nat.add(offset, 12n))), offset,
542            index, record_count)

Uses (11)

Used by (1)