def snapshot.step
mylsm-lsm-store@0.6.0.1 · src/coordinator/StatsCodec.bend:115
import mylsm-lsm-store@0.6.0.1/src/coordinator/StatsCodec.bend as StatsCodec
import Base
115def snapshot.step(
116 entries: Nat,
117 payload_bytes: Nat,
118 snapshots: Nat,
119 scalar: U32,
120 is_digit: Bool,
121 seen: Bool
122) -> State:
123 match is_digit:
124 case True{}:
125 SnapshotDigits{entries, payload_bytes,
126 Nat.add(Nat.mul(snapshots, 10n), digit.value(scalar)), True{}}
127 case False{}:
128 match seen:
129 case False{}: Invalid{}
130 case True{}:
131 separator(SnapshotDigits{entries, payload_bytes, snapshots, True{}},
132 True{}, scalar)