def replay.frame.measured

mylsm-lsm-store@0.6.0.1 · src/transfer/LegacyWal.bend:296

import mylsm-lsm-store@0.6.0.1/src/transfer/LegacyWal.bend as LegacyWal
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

296def replay.frame.measured(
297  bytes: Bytes.Bytes,
298  batches: List<&2, Wal.Batch>,
299  total: Nat,
300  offsets: Nat & Nat,
301  lengths: Nat & Nat
302) -> ReplayState:
303  match offsets:
304    case (slice_offset, end_offset):
305      match lengths:
306        case (end_length, slice_length):
307          +frame_end = Nat.add(end_offset, end_length)
308          +frame_start = Nat.sub(slice_offset, 4n)
309          +serialized_length = Nat.add(slice_length, 4n)
310          ReplayFrame{bytes, frame_start, frame_end, batches,
311            U32.from_nat(serialized_length), Nat.is_le(frame_end, total)}

Uses (11)

Used by (1)