def parse.multi.header.blocks

mylsm-lsm-store@0.6.0.1 · src/ByteSstFile.bend:1464

import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

1464def parse.multi.header.blocks(
1465  pair: Bytes.Bytes & Maybe<&2, U32>,
1466  level: Nat,
1467  total: Nat
1468) -> Result<&1, &1, Error, MultiHeader>:
1469  match pair:
1470    case (file, Some{block_count}):
1471      Done{MultiHeader{file, U32.from_nat(level), U32.from_nat(total),
1472        block_count}}
1473    case _:
1474      Fail{Malformed{}}

Uses (10)

Used by (1)