Package-level declarations
Types
Specifies a custom discriminator type for a @ProtocolMessage sealed interface.
Marks a property as the dispatch value within a @DispatchOn discriminator type.
Wire byte order for ProtocolMessage.wireOrder and WireOrder.
Marks a @ProtocolMessage sealed dispatch parent as forward compatible: a decoder that hits a discriminator it does not recognize skips the unknown variant's framed payload and preserves it verbatim into the unknown variant, instead of throwing DecodeException.
Marks a @ProtocolMessage class (typically a sealed parent) with a framing length prefix that is computed from — and bounds — the body's wire size.
Marks a field whose byte length is determined by a numeric sibling elsewhere in the message — the length is carried as a separate constructor parameter because the consumer cares about it as a number (flow control, routing) or because the on-wire prefix shape is one @LengthPrefixed cannot express (e.g. TLS uint24).
Length prefix encoding for LengthPrefixed fields. All variants use big-endian (network) byte order.
Marks a length-prefixed field: prefix bytes carrying the value's wire size, followed by the value's bytes. Default prefix width is 2-byte big-endian (UShort).
Specifies the discriminator value for a variant of a @ProtocolMessage sealed interface.
Marks a data class or sealed interface as a protocol message. KSP will generate a Codec implementation for this type at compile time.
Marks a field that consumes the remaining bytes of the bounded buffer.
Marks the single sealed-variant sink that a ForwardCompatible union skips unknown discriminators into. The marked variant must not carry PacketType — it is the else arm of dispatch, never matched by value — and its primary constructor must be (opcode: Int, raw: PlatformBuffer) (a ReadBuffer-typed raw is also accepted). For a varint discriminator the opcode parameter is instead the discriminator's own inner type (Long / ULong), carrying the full decoded type value — see ForwardCompatible requirement 3.
Conditional field: only present on the wire when the predicate holds. The field must be nullable. Setting = null as the constructor default is conventional (so the data class can be constructed without naming the field when the predicate is false) but is not enforced — KSP cannot inspect default expression trees, so any rule the validator can't actually check is not part of the contract.
Overrides the byte order for a single field, taking precedence over ProtocolMessage.wireOrder. Use when a protocol mixes byte orders within a single message (e.g., big-endian magic + little-endian lengths).