def item.key.bound.checked

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

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

199# Checks that the key length leaves room for the value length word.
200def item.key.bound.checked(
201  has_value_header: Bool,
202  payload: Bytes.Bytes,
203  size: U32,
204  key_length: U32
205) -> Decision:
206  match has_value_header:
207    case True{}:
208      item.key.bound.read.offset(payload, size,
209        u32.duplicate(key_length))
210    case False{}: Malformed{}

Uses (6)

Used by (1)