def encode.fields
mylsm-lsm-store@0.6.0.1 · src/coordinator/Protocol.bend:109
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
109def encode.fields(
110 +version: U32,
111 +generation: U32,
112 +request_id: U32,
113 +operation: U32,
114 measured: Bytes.Bytes & U32
115) -> Bytes.Bytes:
116 match measured:
117 case (payload, +length):
118 Bytes.concat([magic(), u32.bytes(version), u32.bytes(generation),
119 u32.bytes(request_id), u32.bytes(operation), u32.bytes(length), payload])