pub trait PyTypeAlias: PyStubType {
const NAME: &'static str;
const MODULE: &'static str;
// Required method
fn create_type_object(py: Python<'_>) -> PyResult<Bound<'_, PyAny>>;
}Expand description
Trait for type aliases that can be registered at runtime.
This trait is automatically implemented by the type_alias!
macro. It provides the metadata and factory method needed to register a type alias
in a Python module.
§Associated Constants
NAME- The Python name of the type aliasMODULE- The module where the type alias is defined
§Required Methods
create_type_object- Creates the Python type object representing the alias
Required Associated Constants§
Required Methods§
Sourcefn create_type_object(py: Python<'_>) -> PyResult<Bound<'_, PyAny>>
fn create_type_object(py: Python<'_>) -> PyResult<Bound<'_, PyAny>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.