def response.encode.payload
mylsm-lsm-store@0.6.0.1 · src/coordinator/Protocol.bend:183
import mylsm-lsm-store@0.6.0.1/src/coordinator/Protocol.bend as Protocol
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
183def response.encode.payload(
184 version: U32,
185 generation: U32,
186 request_id: U32,
187 status_code: U32,
188 payload: Bytes.Bytes
189) -> Bytes.Bytes:
190 match payload:
191 case Bytes.Bytes{+length, buffer}:
192 Bytes.Bytes{U32.add(length, 28),
193 response.encode.header(
194 Bytes.dst(Bytes.copy(length, buffer,
195 Bytes.alloc(U32.add(length, 28)), 0, 28)),
196 version, generation, request_id, status_code, length)}