Skip to main content

Module pyclass

Module pyclass 

Source

Re-exportsยง

pub use lazy_type_object::pyclass_type_object_raw;
pub use lazy_type_object::type_object_init_failed;
pub use lazy_type_object::LazyTypeObject;
pub use generate_pyclass_getattro_slot;
pub use generate_pyclass_setattr_slot;
pub use generate_pyclass_setdescr_slot;
pub use generate_pyclass_setitem_slot;
pub use generate_pyclass_add_slot;
pub use generate_pyclass_sub_slot;
pub use generate_pyclass_mul_slot;
pub use generate_pyclass_mod_slot;
pub use generate_pyclass_divmod_slot;
pub use generate_pyclass_lshift_slot;
pub use generate_pyclass_rshift_slot;
pub use generate_pyclass_and_slot;
pub use generate_pyclass_or_slot;
pub use generate_pyclass_xor_slot;
pub use generate_pyclass_matmul_slot;
pub use generate_pyclass_truediv_slot;
pub use generate_pyclass_floordiv_slot;
pub use generate_pyclass_pow_slot;
pub use generate_pyclass_richcompare_slot;
pub use assertions::*;
pub use probes::*;

Modulesยง

assertions ๐Ÿ”’
doc
generic_pyclass ๐Ÿ”’
lazy_type_object ๐Ÿ”’
probes ๐Ÿ”’
pymethods ๐Ÿ”’
pyo3_get_field ๐Ÿ”’
sealed ๐Ÿ”’

Macrosยง

define_pyclass_binary_operator_slot ๐Ÿ”’
Macro which expands to three items
define_pyclass_setattr_slot ๐Ÿ”’
Macro which expands to three items
slot_fragment_trait ๐Ÿ”’

Structsยง

ConvertField
NoopThreadChecker ๐Ÿ‘ป
Default thread checker for #[pyclass].
PyClassDictSlot
Actual dict field, which holds the pointer to __dict__.
PyClassDummySlot
Zero-sized dummy field.
PyClassGetterGenerator
Type which uses specialization on impl blocks to determine how to read a field from a Rust pyclass as part of a #[pyo3(get)] annotation.
PyClassImplCollector
This type is used as a โ€œdummyโ€ type on which dtolnay specializations are applied to apply implementations from #[pymethods]
PyClassItems
PyClassItemsIter
Iterator used to process all class items during type instantiation.
PyClassWeakRefSlot
Actual weakref field, which holds the pointer to __weakref__.
ThreadCheckerImpl ๐Ÿ‘ป
Thread checker for #[pyclass(unsendable)] types. Panics when the value is accessed by another thread.

Enumsยง

PyObjectOffset
Offset of a field within a PyObject in bytes.

Staticsยง

NO_PY_CLASS_ITEMS
Shared empty items, used by the macros for classes without any intrinsic items to keep the generated code small.

Traitsยง

PyClassBaseType
Trait denoting that this class is suitable to be used as a base type for PyClass.
PyClassDict
Represents the __dict__ field for #[pyclass].
PyClassImpl
Implements the underlying functionality of #[pyclass], assembled by various proc macros.
PyClassThreadChecker ๐Ÿ‘ป
PyClassWeakRef
Represents the __weakref__ field for #[pyclass].
PyClassWithFreeList
Implements a freelist.
PyClass__add__SlotFragment
PyClass__and__SlotFragment
PyClass__delattr__SlotFragment
PyClass__delete__SlotFragment
PyClass__delitem__SlotFragment
PyClass__divmod__SlotFragment
PyClass__eq__SlotFragment
PyClass__floordiv__SlotFragment
PyClass__ge__SlotFragment
PyClass__getattr__SlotFragment
PyClass__getattribute__SlotFragment
PyClass__gt__SlotFragment
PyClass__le__SlotFragment
PyClass__lshift__SlotFragment
PyClass__lt__SlotFragment
PyClass__matmul__SlotFragment
PyClass__mod__SlotFragment
PyClass__mul__SlotFragment
PyClass__ne__SlotFragment
PyClass__or__SlotFragment
PyClass__pow__SlotFragment
PyClass__radd__SlotFragment
PyClass__rand__SlotFragment
PyClass__rdivmod__SlotFragment
PyClass__rfloordiv__SlotFragment
PyClass__rlshift__SlotFragment
PyClass__rmatmul__SlotFragment
PyClass__rmod__SlotFragment
PyClass__rmul__SlotFragment
PyClass__ror__SlotFragment
PyClass__rpow__SlotFragment
PyClass__rrshift__SlotFragment
PyClass__rshift__SlotFragment
PyClass__rsub__SlotFragment
PyClass__rtruediv__SlotFragment
PyClass__rxor__SlotFragment
PyClass__set__SlotFragment
PyClass__setattr__SlotFragment
PyClass__setitem__SlotFragment
PyClass__sub__SlotFragment
PyClass__truediv__SlotFragment
PyClass__xor__SlotFragment
PyMethodsNon-multiple-pymethods
PyO3GetField

Functionsยง

alloc_with_freelistโš 
Implementation of tp_alloc for freelist classes.
assign_sequence_item_from_mapping ๐Ÿ”’ โš 
check_richcmp_arg_typeโš 
Helper which defends richcmp implementations against invalid argument types. PyPy does not check the input argument type if e.g. Foo.__eq__(object(), 1), so we add this check here to allow downstream code to assume the correct argument type.
dict_offset
Gets the offset of the dictionary from the start of the object in bytes.
ensure_no_mutable_alias ๐Ÿ”’ โš 
ensures obj is not mutably aliased
free_with_freelistโš 
Implementation of tp_free for freelist classes.
get_sequence_item_from_mapping ๐Ÿ”’ โš 
pyo3_get_value_into_pyobject ๐Ÿ”’ โš 
Gets a field value from a pyclass and produces a python value using IntoPyObject for FieldT, after cloning the value.
pyo3_get_value_into_pyobject_ref ๐Ÿ”’ โš 
Gets a field value from a pyclass and produces a python value using IntoPyObject for &FieldT
tp_dealloc ๐Ÿ”’ โš 
Implementation of tp_dealloc for pyclasses without gc
tp_dealloc_with_gc ๐Ÿ”’ โš 
Implementation of tp_dealloc for pyclasses with gc
weaklist_offset
Gets the offset of the weakref list from the start of the object in bytes.
โš ๏ธ Internal Docs โš ๏ธ Not Public API ๐Ÿ‘‰ Official Docs Here