packet/packet library

Classes

Bool
Represents a native bool in C.
ByteField<V extends NativeType>
Typed Offset
ByteStructBase<S extends ByteStructBase<S, K>, K extends ByteField<NativeType>>
ByteStructBuffer<T>
buffer type for partial view
Double
Represents a native 64 bit double in C.
Float
Represents a native 32 bit float in C.
Int16
Represents a native signed 16 bit integer in C.
Int32
Represents a native signed 32 bit integer in C.
Int64
Represents a native signed 64 bit integer in C.
Int8
Represents a native signed 8 bit integer in C.
NativeType
NativeType's subtypes represent a native type in C.
Packet
Packet as interface for immutable view of varying view length.
PacketBuffer<T extends Packet>
/////////////////////////////////////////////////////////////////////////
PacketFormat<T extends Packet>
Collective def of Packet format. Descriptor/'Class variables'
PacketId
PacketIdCaster
///////////////////////////////////////////////////////////////////////// PacketId Types ///////////////////////////////////////////////////////////////////////// build idOf from lists internally PacketIdFactory
PacketIdRequest<T, R>
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
PacketPayloadId<V>
PacketSyncId
Payload<V>
///////////////////////////////////////////////////////////////////////////// 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
PayloadMeta
any additional state not included in the header
Struct
The supertype of all FFI struct types.
TypedDataBuffer
TypedDataBuffer - BytesBuilderBuffer effectively, a fixed size BytesBuilder - allocated with a persistent buffer
TypedField<T extends NativeType>
StructField/NativeKey/StructKey, Typed 0,1,2,4,8 bytes
Uint16
Represents a native unsigned 16 bit integer in C.
Uint32
Represents a native unsigned 32 bit integer in C.
Uint64
Represents a native unsigned 64 bit integer in C.
Uint8
Represents a native unsigned 8 bit integer in C.

Extension Types

ByteForm
ByteStruct
ByteStruct is a TypedData with keyed/named access to fields. TypedData + [] Map operators returning int keyed view mixin keyed access for serialization map

Extensions

ByteDataArrayAccess on ByteData
ByteDataWordAccess on ByteData
PacketIdMethods on PacketId
TypedDataCast on TypedData
///////////////////////////////////////////////////////////////////////////// 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
TypedDataLength on TypedData
///////////////////////////////////////////////////////////////////////////// implementations on TypedData returning as this type parameters in element size of this type /////////////////////////////////////////////////////////////////////////////
TypedDataListSeek on T
TypedList version of List<int>.skip
TypedDataSlices on T
Slices returning TypedData Slices on List cannot return TypedData

Functions

bytesPerElementOf<T extends TypedData>() int
fromListInt<T extends TypedDataList<int>>(List<int> elements) → T
sublistView<T extends TypedData>(TypedData data, [int start = 0, int? end]) → T
GenericSublistView offset in elements, type of data, not T type.
typedList<T extends TypedDataList>(int length) → T
///////////////////////////////////////////////////////////////////////////// Wrappers as top level functions ///////////////////////////////////////////////////////////////////////////// length is in elements same as ByteData(length * bytesPerElementOf<T>())

Typedefs

PacketCaster<P extends Packet> = P Function(TypedData typedData)
PayloadCaster<V> = Payload<V> Function(TypedData typedData)
Payload Constructor - handler per id Struct.create<T>
TypedDataCaster<T> = T Function(TypedData typedData)
T is ByteStruct or ffi.Struct