Id as payload factory
A Request matched with a Response
paired request response id for simplicity in case of shared id by request and response
can under define responseId for 1-way
handlers as constructors, const for enum
/////////////////////////////////////////////////////////////////////////////
Payload<V>
/////////////////////////////////////////////////////////////////////////////
extends Struct and Payload
Payload need to contain a static cast function
factory Child.cast(TypedData target);
convert in place, on allocated buffer
build/parse with a reference to the header, although both are part of a contiguous buffer
payload class without direct context of header
allows stronger encapsulation
does not have to declare filler header fields
for simplicity, the packet header includes all meta parameters, parsing a payload does not need stateMeta
ByteStruct is a TypedData with keyed/named access to fields.
TypedData + [] Map operators returning int
keyed view
mixin keyed access for serialization map
/////////////////////////////////////////////////////////////////////////////
sublistView using length instead of end
Effectively moving up ByteBuffer layer, to TypedData view segment accounting for this.offsetInBytes
/////////////////////////////////////////////////////////////////////////////
offsets in bytes for simplicity, correspond with ByteBuffer
length using type size
/////////////////////////////////////////////////////////////////////////////
implementations on TypedData returning as this type
parameters in element size of this type
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
Wrappers as top level functions
/////////////////////////////////////////////////////////////////////////////
length is in elements
same as ByteData(length * bytesPerElementOf<T>())