after
Parameters
after
Names a sibling constructor field that the prefix sits immediately after on the wire. Empty (default) means the prefix is at offset 0. The named field must exist and — when the class carries @PacketType — be the discriminator. It must either have Exact wire width (fixed-width scalars / value classes wrapping them) or be a varint value class (inner scalar carrying @UseCodec(<VariableLengthCodec>), e.g. an HTTP/3 frame type): the emit then measures the header's width per value via the codec instead of a compile-time constant.
@ProtocolMessage
@FramedBy(MqttRemainingLengthCodec::class, after = "header")
sealed interface MqttPacket {
// Each variant declares its own header field; the framework writes
// the prefix between header and body, computed from body bytes.
}Content copied to clipboard