def walk.position.measured

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

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/coordinator/QueuePolicy.bend as QueuePolicy
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

108# Prepares independent frame-size and endpoint lengths for the cursor state.
109def walk.position.measured(
110  pair: Bytes.Cursor & U32,
111  frames: Nat,
112  lengths: Nat & Nat
113) -> WalkState:
114  match pair:
115    case (cursor, position):
116      match lengths:
117        case (frame_length, endpoint_length):
118          Position{cursor, QueuePolicy.nat.clone.pair(U32.to_nat(position)),
119            U32.from_nat(Nat.add(frame_length, 4n)),
120            U32.from_nat(endpoint_length), frames}

Uses (10)

Used by (1)