[][src]Trait pyo3::PyNativeType

pub unsafe trait PyNativeType: Sized {
    fn py(&self) -> Python<'_> { ... }
unsafe fn unchecked_downcast(obj: &PyAny) -> &Self { ... } }

Types that are built into the Python interpreter.

PyO3 is designed in a way that all references to those types are bound to the GIL, which is why you can get a token from all references of those types.

Provided methods

fn py(&self) -> Python<'_>

unsafe fn unchecked_downcast(obj: &PyAny) -> &Self

Cast &PyAny to &Self without no type checking.

Safety

obj must have the same layout as *const ffi::PyObject and must be an instance of a type corresponding to Self.

Loading content...

Implementors

impl PyNativeType for PyModule[src]

impl PyNativeType for PyAny[src]

impl PyNativeType for PyBool[src]

impl PyNativeType for PyByteArray[src]

impl PyNativeType for PyBytes[src]

impl PyNativeType for PyComplex[src]

impl PyNativeType for PyDate[src]

impl PyNativeType for PyDateTime[src]

impl PyNativeType for PyDelta[src]

impl PyNativeType for PyDict[src]

impl PyNativeType for PyFloat[src]

impl PyNativeType for PyFrozenSet[src]

impl PyNativeType for PyList[src]

impl PyNativeType for PyLong[src]

impl PyNativeType for PySequence[src]

impl PyNativeType for PySet[src]

impl PyNativeType for PySlice[src]

impl PyNativeType for PyString[src]

impl PyNativeType for PyTime[src]

impl PyNativeType for PyTuple[src]

impl PyNativeType for PyType[src]

impl PyNativeType for PyTzInfo[src]

impl<T: PyClass> PyNativeType for PyCell<T>[src]

Loading content...