def decode.checksum
mylsm-lsm-store@0.6.0.1 · src/ByteWal.bend:913
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
913
914def decode.checksum(
915 frame: Bytes.Bytes,
916 +total: U32,
917 result: Result<&1, &1, Wal.Error, ParsedBatch>
918) -> Result<&1, &1, Wal.Error, Batch>:
919 match result:
920 case Fail{error}:
921 Fail{error}
922 case Done{ParsedBatch{+offset, batch}}:
923 decode.checksum.offset(frame, batch, total,
924 U32.is_eq(offset, (total - 32 : U32)))