def item.value.bound.compare

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

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

130# Accepts only a value length that ends exactly at the frame boundary.
131def item.value.bound.compare(
132  payload: Bytes.Bytes,
133  size: U32,
134  key_lengths: U32 & U32,
135  value_lengths: U32 & U32
136) -> Decision:
137  match key_lengths:
138    case (checked_key_length, retained_key_length):
139      match value_lengths:
140        case (checked_value_length, retained_value_length):
141          item.value.bound.checked(Nat.is_eq(U32.to_nat(size),
142            Nat.add(9n, Nat.add(U32.to_nat(checked_key_length),
143              U32.to_nat(checked_value_length)))), payload,
144            retained_key_length, retained_value_length)

Uses (9)

Used by (1)