def response.length.checked
mylsm-lsm-store@0.6.0.1 · src/coordinator/Io.bend:672
import mylsm-lsm-store@0.6.0.1/src/coordinator/Io.bend as Io
import Base
import mylsm-lsm-store@0.6.0.1/src/coordinator/Protocol.bend as Protocol
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
672def response.length.checked(
673 file: File,
674 header: Bytes.Bytes,
675 lengths: U32 & U32 & U32
676) -> IO(File & Result<&1, &1, Error, Protocol.Response>):
677 match lengths:
678 case (read_length, (checked_length, _)):
679 response.length.admitted(file, header, read_length,
680 U32.is_le(checked_length, U32.from_nat(max_payload_bytes())))