Fields: accessors of the class (not own properties, as in Python).
Create a new struct instance.
Positional values matching field order, or a single object with field names as keys
Static Optional_Field definitions. Array of [name, type] tuples, or [name, type, bits] for bit fields.
Static Optional_Maximum field alignment in bytes, as Python's _pack_ (1 = no padding).
true is accepted as 1.
Static Optional_Bit field layout, as Python's _layout_: "gcc-sysv" (default except on
Windows) or "ms" (default on Windows and with _pack_).
Static Optional_Minimum alignment in bytes, as Python's _align_.
Static Optional_List of field names whose members are promoted to the parent struct.
Python equivalent: _anonymous_
Static ReadonlysizeSize in bytes (Python: sizeof(cls)).
Static ReadonlyalignmentAlignment in bytes (Python: alignment(cls)).
Static ReadonlyfieldsField descriptors, in layout order.
The underlying memory buffer. Passed automatically to native functions.
The struct definition metadata.
StaticcreateStatictoStaticfrom_Create an instance that aliases memory inside an existing Buffer. Writes through the instance propagate to the source Buffer.
Python ctypes parity: Structure.from_buffer(source, offset=0).
Optionaloffset: numberStaticfrom_Create an instance whose buffer is an independent copy of the source bytes.
Python ctypes parity: Structure.from_buffer_copy(source, offset=0).
Optionaloffset: numberStaticfrom_Create an instance that views raw memory at address. Caller is
responsible for ensuring the memory stays valid and is at least
sizeof(this) bytes.
Python ctypes parity: Structure.from_address(address).
Staticin_Read a field value by name.
Write a field value by name.
Convert all fields to a plain JavaScript object (snapshot).
The fields, for JSON.stringify (same as toObject).
Union subclass with big-endian primitive fields.
Python equivalent:
ctypes.BigEndianUnion