def decode.header.validated

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

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

821# Converts the pure frame bound decision into a typed outcome.
822def decode.header.validated(
823  frame: Bytes.Bytes,
824  frame_length: U32,
825  count: U32,
826  total: U32,
827  valid: Bool
828) -> Result<&1, &1, Wal.Error, FrameHeader>:
829  match valid:
830    case False{}:
831      Fail{Wal.Malformed{}}
832    case True{}:
833      Done{FrameHeader{frame, frame_length, count, total}}

Uses (6)

Used by (1)