def parse.block.length

mylsm-lsm-store@0.6.0.1 · src/SstFile.bend:1008

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

1008def parse.block.length(
1009  pair: Bytes.Cursor & Maybe<&2, U32>,
1010  previous: Maybe<&2, String>
1011) -> Bytes.Cursor & Result<&1, &1, Error, ParsedBlock>:
1012  match pair:
1013    case (cursor, Some{+payload_len}):
1014      parse.block.count(Bytes.Cursor.u32be(cursor), payload_len, previous)
1015    case (cursor, None{}):
1016      (cursor, Fail{Malformed{}})

Uses (11)

Used by (1)