Skip to main content

Module object

Module object 

Source

Structs§

Py
This is an actual python object. It consists of a typ which is the python class, and carries some rust payload optionally. This rust payload can be a rust float or rust int in case of float and int objects.
PyAtomicBorrow
Atomic borrowed (non-ref-counted) optional reference to a Python object. Unlike PyAtomicRef, this does NOT own the reference. The pointed-to object must outlive this reference.
PyAtomicRef
PyExact
PyObject
PyObjectCell
A nullable object reference that can be replaced without invalidating readers.
PyObjectRef
The PyObjectRef is one of the most used types. It is a reference to a python object. A single python object can have multiple references, and this reference counting is accounted for by this type. Use the .clone() method to create a new reference and increment the amount of references to the python object by 1.
PyRef
A reference to a Python object.
PyRefExact
PyRef but guaranteed not to be a subtype instance
PyStackRef
A tagged stack reference to a Python object.
PyWeak
PyWeakRef

Constants§

SIZEOF_PYOBJECT_HEAD

Traits§

AsObject
MaybeTraverse
This trait is used as a “Optional Trait”(I ’d like to use Trace? but it’s not allowed yet) for PyObjectPayload type
PyObjectPayload
PyPayload
Native subclasses declared with #[pyclass(base = Base)] share the base’s payload type ID. Their base field must start at offset zero, and their payload must start at the same offset inside Py<T> as the base payload. The derived object must also meet the base object’s alignment requirement. The macro checks these conditions at compile time. repr(C) on the payload alone does not guarantee the second condition:
PyThreadingConstraint
SlotOffset
Traverse
Type that need traverse it’s children should impl Traverse (not MaybeTraverse)

Functions§

dict_member_offset
Byte offset of the instance-dict pointer from the start of Py.
payload_offset
Byte offset of the payload inside Py<T>.

Type Aliases§

PyResult
Use this type for functions which return a python object or an exception. Both the python object and the python exception are PyObjectRef types since exceptions are also python objects.
TraverseFn