def item.key.bound.check

mylsm-lsm-store@0.6.0.1 · src/coordinator/CursorCodec.bend:212

import mylsm-lsm-store@0.6.0.1/src/coordinator/CursorCodec.bend as CursorCodec
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes

212# Accepts key lengths that leave a complete value length word.
213def item.key.bound.check(
214  payload: Bytes.Bytes,
215  sizes: U32 & U32,
216  key_lengths: U32 & U32
217) -> Decision:
218  match sizes:
219    case (checked_size, retained_size):
220      match key_lengths:
221        case (checked_key_length, retained_key_length):
222          item.key.bound.checked(Nat.is_le(
223            Nat.add(9n, U32.to_nat(checked_key_length)),
224            U32.to_nat(checked_size)), payload, retained_size,
225            retained_key_length)

Uses (9)

Used by (1)