def recover.counted
mylsm-lsm-store@0.6.0.1 · src/ByteWalIo.bend:89
import mylsm-lsm-store@0.6.0.1/src/ByteWalIo.bend as ByteWalIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
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
89def recover.counted(
90 file: File,
91 +size: Nat,
92 +offset: Nat,
93 table: ByteMemTable.Table,
94 prefix: Bytes.Bytes,
95 count_bytes: Bytes.Bytes,
96 +frame_length: U32,
97 parsed: Maybe<&2, U32>
98) -> RecoveryState:
99 match parsed:
100 case None{}:
101 Failed{file, error("malformed byte WAL frame count")}
102 case Some{+count}:
103 Counted{file, size, offset, table, prefix, count_bytes,
104 frame_length, Wal.frame_length_allowed(count, frame_length)}