def item.value.slices

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

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

107# Slices the key first so the source remains available for the value slice.
108def item.value.slices(
109  payload: Bytes.Bytes,
110  key_lengths: U32 & U32,
111  value_length: U32
112) -> Decision:
113  match key_lengths:
114    case (key_length, value_key_length):
115      item.value.key.sliced(Bytes.slice(payload, 5, key_length),
116        U32.from_nat(Nat.add(9n, U32.to_nat(value_key_length))), value_length)

Uses (10)

Used by (1)