Class: Struct<T>
A type that represents a structure of multiple fields. Similar to an object in JavaScript.
Type Parameters
Type Parameter | Description |
---|---|
| The type of the structure where each key is a field name and the value is the type of the field. |
Implements
BaseType
<T
>
Constructors
new Struct()
new Struct<
T
>(entries
:StructTypes
<T
>):Struct
<T
>
Creates a new structure type.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The entries of the structure where each key is a field name and the value is the type of the field. |
Returns
Struct
<T
>
Defined in
Methods
write()
write(
value
:T
,writer
:BufferWriter
):void
Writes the structure to the buffer.
Parameters
Parameter | Type | Description |
---|---|---|
|
| The structure to write. |
| The buffer writer. |
Returns
void
Implementation of
Defined in
read()
read(
reader
:BufferReader
):T
Reads the structure from the buffer.
Parameters
Parameter | Type | Description |
---|---|---|
| The buffer reader. |
Returns
T
The structure read from the buffer.