[−][src]Trait pyo3::type_object::PyTypeInfo
Python type information.
All Python native types(e.g., PyDict
) and #[pyclass]
structs implement this trait.
This trait is marked unsafe because:
- specifying the incorrect layout can lead to memory errors
- the return value of type_object must always point to the same PyTypeObject instance
Associated Types
type Type
[src]
Type of objects to store in PyObject struct
type BaseType: PyTypeInfo + PyTypeObject
[src]
Base class
type Layout: PyLayout<Self>
[src]
Layout
type BaseLayout: PySizedLayout<Self::BaseType>
[src]
Layout of Basetype.
type Initializer: PyObjectInit<Self>
[src]
Initializer for layout
type AsRefTarget: PyNativeType
[src]
Utility type to make Py::as_ref work
Associated Constants
pub const NAME: &'static str
[src]
Class name
pub const MODULE: Option<&'static str>
[src]
Module name, if any
pub const DESCRIPTION: &'static str
[src]
Class doc string
pub const FLAGS: usize
[src]
Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)
Required methods
pub fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
[src]
PyTypeObject instance for this type.
Provided methods
pub fn is_type_of(object: &PyAny) -> bool
[src]
Checks if object
is an instance of this type or a subclass of this type.
pub fn is_exact_type_of(object: &PyAny) -> bool
[src]
Checks if object
is an instance of this type.