pub trait PyClass: PyTypeInfo<AsRefTarget = PyCell<Self>> + PyClassImpl<Layout = PyCell<Self>> {
type Dict: PyClassDict;
type WeakRef: PyClassWeakRef;
type BaseNativeType: PyTypeInfo + PyNativeType;
}
Expand description
If PyClass
is implemented for a Rust type T
, then we can use T
in the Python
world, via PyCell
.
The #[pyclass]
attribute automatically implements this trait for your Rust struct,
so you normally don’t have to use this trait directly.
Associated Types
The closest native ancestor. This is PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.