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
Schema<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(
writer:ByteStreamWriter,value:T):void
Writes the structure to the buffer.
Parameters
| Parameter | Type | Description |
|---|---|---|
| The buffer writer. | |
|
| The structure to write. |
Returns
void
Implementation of
Schema.write
Defined in
read()
read(
reader:ByteStreamReader):T
Reads the structure from the buffer.
Parameters
| Parameter | Type | Description |
|---|---|---|
| The buffer reader. |
Returns
T
The structure read from the buffer.
Implementation of
Schema.read