pyo3_ffi/pytypedefs.rs
1// NB: unlike C, we do not need to forward declare structs in Rust.
2// So we only define opaque structs for those which do not have public structure.
3//
4// Some of these structs defined below only for the opaque PyObject ABI
5// (e.g. all(Py_GIL_DISABLED, Py_LIMITED_API)) since we need to define
6// the structs but can't know their layout
7
8// PyModuleDef_Slot
9// PyMethodDef
10// PyGetSetDef
11// PyMemberDef
12
13// PyLongObject
14opaque_struct!(pub PyCodeObject);
15opaque_struct!(pub PyFrameObject);
16
17opaque_struct!(pub PyThreadState);
18opaque_struct!(pub PyInterpreterState);
19#[cfg(all(Py_LIMITED_API, Py_GIL_DISABLED))]
20opaque_struct!(pub PyModuleDef);
21#[cfg(Py_LIMITED_API)]
22opaque_struct!(pub PyTypeObject);
23#[cfg(all(Py_LIMITED_API, Py_GIL_DISABLED))]
24opaque_struct!(pub PyObject);
25#[cfg(all(Py_LIMITED_API, Py_GIL_DISABLED))]
26opaque_struct!(pub PyVarObject);