def parse.block.count

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

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

1251def parse.block.count(
1252  pair: Bytes.Bytes & Maybe<&2, U32>,
1253  payload_length: U32
1254) -> Result<&1, &1, Error, ByteMemTable.Table>:
1255  match pair:
1256    case (block, Some{count}):
1257      parse.block.count.copy(block, count,
1258        QueuePolicy.nat.clone.pair(U32.to_nat(payload_length)))
1259    case (_, None{}):
1260      Fail{Malformed{}}

Uses (11)

Used by (1)