def put.bound.checked
mylsm-lsm-store@0.6.0.1 · src/coordinator/Operation.bend:85
import mylsm-lsm-store@0.6.0.1/src/coordinator/Operation.bend as Operation
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
85def put.bound.checked(
86 payload: Bytes.Bytes,
87 actual_length: U32,
88 key_lengths: U32 & U32 & U32,
89 value_lengths: U32 & U32 & U32
90) -> Decision:
91 match key_lengths:
92 case (key_check, (key_length, key_offset)):
93 match value_lengths:
94 case (value_check, (value_length, value_copy)):
95 put.bound.result(
96 Nat.is_eq(U32.to_nat(actual_length),
97 Nat.add(8n, Nat.add(U32.to_nat(key_check),
98 U32.to_nat(value_check)))),
99 payload, (key_length, key_offset), (value_length, value_copy))