def decode.header.count

mylsm-lsm-store@0.6.0.1 · src/ByteWal.bend:835

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

835# Validates the declared count and full frame length.
836def decode.header.count(
837  pair: Bytes.Bytes & Maybe<&2, U32>,
838  +frame_length: U32,
839  +total: U32
840) -> Result<&1, &1, Wal.Error, FrameHeader>:
841  match pair:
842    case (_, None{}):
843      Fail{Wal.Malformed{}}
844    case (frame, Some{+count}):
845      decode.header.validated(frame, frame_length, count, total,
846        frame.bounds.valid(frame_length, count, total))

Uses (10)

Used by (1)