def decode.size.checked
import mylsm-lsm-store@0.6.0.1/src/coordinator/CursorCodec.bend as CursorCodecimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
359# Decodes a complete cursor response, rejecting unknown tags and trailing data.
360def decode.size.checked(
361 payload: Bytes.Bytes,
362 sizes: U32 & U32
363) -> Decision:
364 match sizes:
365 case (checked_size, retained_size):
366 decode.nonempty(payload, retained_size, U32.is_le(1, checked_size))