PacketConsumer.Packet


sealed interface PacketConsumer.Packet<T : Any?>

Known direct subclasses
PacketConsumer.Packet.EndOfStream

A Packet implementation to represent an end of stream (EOS) signal.

PacketConsumer.Packet.Payload

A Packet implementation to wrap a payload of type T.


Represents a packet.

The Packet could carry either Payload or EndOfStream.

Parameters
<T : Any?>

The type of the Payload.payload contained within the packet.

Summary

Nested types

A Packet implementation to represent an end of stream (EOS) signal.

A Packet implementation to wrap a payload of type T.

Public companion functions

PacketConsumer.Packet<T>
<T : Any?> of(payload: T)

Creates an immutable Payload.

Public companion functions

of

fun <T : Any?> of(payload: T): PacketConsumer.Packet<T>

Creates an immutable Payload.

Parameters
payload: T

The data to be carried by the packet.

Returns
PacketConsumer.Packet<T>

A new Packet instance wrapping the payload.