Trait pyo3::conversion::AsPyPointer [−][src]
Expand description
This trait represents that we can do zero-cost conversion from the object to a FFI pointer.
This trait is implemented for types that internally wrap a pointer to a Python object.
Examples
use pyo3::{AsPyPointer, prelude::*}; Python::with_gil(|py| { let dict = pyo3::types::PyDict::new(py); // All native object wrappers implement AsPyPointer!!! assert_ne!(dict.as_ptr(), std::ptr::null_mut()); });
Required methods
Implementations on Foreign Types
Convert None
into a null pointer.