Fields: accessors of the class (not own properties, as in Python).
Create a new instance.
Positional values matching field order (a single Buffer is
a positional value too, not the memory: use from_buffer / create(buffer)),
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_ (a boolean or BigInt is a Python int; 0 means 1).
Static Optional_List of field names whose members are promoted to the parent struct.
Python equivalent: _anonymous_
Static Optional_Declaring _abstract_ (any value, as in CPython) makes the class
abstract: construction, from_buffer, from_buffer_copy, from_address
and in_dll throw TypeError abstract class. Not inherited.
Static Optional__Python 3.14 T.__pointer_type__: the type POINTER(T) returns,
set by the first POINTER(T) (undefined before, not inherited by
subclasses). Writable and deletable.
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.
StaticcreateCreate instance with optional initial values, or over a copy-free view of a Buffer.
StatictoConvert a buffer or instance to a plain object.
Staticfrom_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: BufferOffsetStaticfrom_Create an instance whose buffer is an independent copy of the source bytes.
Python ctypes parity: Structure.from_buffer_copy(source, offset=0).
Optionaloffset: BufferOffsetStaticfrom_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_Bind the Structure to an exported global variable in a shared library. Reads/writes through the returned instance go to/from the DLL's memory.
Python ctypes parity: Structure.in_dll(library, name); a missing
symbol is a RangeError (Python ValueError: "symbol 'name' not found" on
Windows, the dlerror() text on Linux and macOS).
Staticfrom_Default CPython-compatible parameter adapter hook (Structure.from_param).
Convert all fields to a plain JavaScript object (snapshot).
Structure subclass with explicit little-endian layout. On the LE hosts we officially support this is identical to plain Structure; it exists for API symmetry with BigEndianStructure and to document intent.
Python equivalent:
ctypes.LittleEndianStructure