PacketConsumer.Packet


interface PacketConsumer.Packet<T : Any?>


Represents a data packet that wraps a payload.

Parameters
<T : Any?>

The type of the payload contained within the packet.

Summary

Public companion functions

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

Creates a default, immutable Packet implementation.

Public properties

T

The data carried by this packet.

Public companion functions

of

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

Creates a default, immutable Packet implementation.

Parameters
payload: T

The data to be carried by the packet.

Returns
PacketConsumer.Packet<T>

A new Packet instance wrapping the payload.

Public properties

payload

val payload: T

The data carried by this packet.