This is the constructor
of the Struct type that gets returned.
Invoke it with new
to create a new Buffer instance backing the union.
Pass it an existing Buffer instance to use that as the backing buffer.
Pass in an Object containing the union fields to auto-populate the
union with the data.
Pass it an existing Buffer instance to use that as the backing buffer.
any
any
Pass it an existing Buffer instance to use that as the backing buffer.
any
any
The alignment of this datatype when placed inside a struct.
{ type: "ref".Type; }
The current level of indirection of the buffer.
The name to use during debugging for this datatype.
The size in bytes required to hold this datatype.
Adds a new field to the union instance with the given name and type. Note that this function will throw an Error if any instances of the union type have already been created, therefore this function must be called at the beginning, before any instances are created.
Adds a new field to the union instance with the given name and type. Note that this function will throw an Error if any instances of the union type have already been created, therefore this function must be called at the beginning, before any instances are created.
To invoke when ref.get
is invoked on a buffer of this type.
any
To invoke when ref.set
is invoked on a buffer of this type.
Custom for union type instances.
string